[If you don’t understand my english, tell me, it may be normal ]
I’ve some beginner questions (again). But certainly I don’t understand because I don’t understand the Julia’s behaviour. I’ve some knows about programming language (i’ve already made a little compiler, but that was some years ago).
What do we need to import functions in order to extend them ? If we can call them, that means their name are known, no ? So, what can’t you extend them ? What is the Julia’s behaviour ?
What about the functions type ? typeof(f) tells me typeof(f). If I’ve well understood, that’s because each function has its own type, and all the “functions” are methods. That means that I can’t tell, in some syntax example(f::Function{Int64,Int64}, arg::Int64) = f(x+1) - 1 which Function{Int64,Int64} is the function type Int64 -> Int64 ?
(in fact, i’ve seen that seem to exists some ways to do this in the doc, but I havn’t understood)
Does there exist tools in order to do syntax analysis in Julia ? (to make a parser, as Menhir in OCaml) If no, is it possible to “import” OCaml code ? (i’ve seen it’s possible with at least C and Python code)
In a similar way, does there exist in Julia a package to manage the “inputs/parameters” of my program ? In example : julia myprogram.jl -o output -g parameter, a package which simplify the managing of the -o output and the -g parameter ?
Is it possible to “compile” Julia ? To make an executable, which would work without the Julia interpretor ?
I havn’t found the supported regex syntax in Julia. I’ve searched in the PCRE Ruby doc, but I havn’t found yet : is it somewhere ?
I think it’s all ! Thanks for reading and mayber answering ! (and thanks another time to the Julia’s developpers )
function type is Function to the best of my knowledge there is no direct way to have a function type including argument/output types so something like Function{Int64,Int64} this has been discussed but probably someone with better knowledge may be able to give better pointers
regex, yes try Regex(...) to define a pattern (or r“...”) and functions like match, eachmatch, replace etc see also the docs: Strings · The Julia Language
I meant that I wanted the abstract syntax of the right regex in Julia language. It seemed to me that there could be little differences in the regex syntax among the languages. Am I wrong ?
Errr, this discussion is a little bit empty, linkless. If I ask, that means that I didn’t find answers, and I don’t have really time in order to read a thesis.
Correct, that’s not a feature of Julia right now. In most cases, we deal with this by duck-typing (that is, just accepting any function and throwing an error later on if it turns out to not accept the desired type).
If you are referring to either explicit import or qualified method names, it has a simple explanation.
Consider
module Foo
using Bar # has no function baz
baz() = 1
end
Now imagine that the developers of Bar introduce their own function baz and export it. From that point you would be adding/overwriting methods to that, which can lead to bugs (search for type piracy).