<adrien>
hmmm, only one thing: what does it do with comments?
<adrien>
I need to get: the function declarations from cpp files and the comments before/after them
<adrien>
"elsa does not include a preprocessor" =/
<edwin>
I don't know about elkhound, but clang should have a way to preserve comments
<edwin>
and there is a binary AST emission feature in clang
<edwin>
don't know how stable the format is, but if its stable, it should be possible to read it back in ocaml using bitstring
<adrien>
ok, I'll see
<adrien>
I should start with yacfe: its C++ support isn't complete but it might work
arubin has joined #ocaml
vivanov has quit [Remote host closed the connection]
vivanov has joined #ocaml
groves has left #ocaml []
Smerdyakov has quit [Quit: Leaving]
impy has left #ocaml []
<thelema_>
orbitz: there is some sort of list comprehension camlp4 in the standard distribution somewhere, as I recall there being a bug in it on mantis
thelema has joined #ocaml
vivanov has quit [Ping timeout: 252 seconds]
vivanov has joined #ocaml
thelema_ has quit [Ping timeout: 258 seconds]
Snark has quit [Quit: Ex-Chat]
Yoric has joined #ocaml
smerz has quit [Quit: Ex-Chat]
impy has joined #ocaml
sepp2k has joined #ocaml
ymasory has quit [Quit: Leaving]
Associ8or has joined #ocaml
Associ8or has quit [Changing host]
Associ8or has joined #ocaml
Associat0r has quit [Ping timeout: 246 seconds]
philtor has quit [Ping timeout: 246 seconds]
ski has quit [Ping timeout: 246 seconds]
ski has joined #ocaml
philtor has joined #ocaml
TimurSoft has joined #ocaml
<TimurSoft>
hello all, I have seen "let () = ..." in a main.ml, could anyone tell me why there is no name for this signature of a function?
<adrien>
TimurSoft: it's not a function, it's a toplevel value, it'll get executed when the module is loaded
<adrien>
so it can be used for some kind of "main" function (in C) or initialization code
<TimurSoft>
I see... so could we say in a "main", every function is packed within a "let ... = ", for instance, we need to code "let () = Printf.print ..." instead of "Printf.print ..." directly?
jderque has quit [Quit: leaving]
enthymeme has joined #ocaml
<edwin>
with the original syntax yes
<edwin>
its like main in C, or __attribute__((constructor)) for shared libs
<edwin>
with the revised syntax the 'let () =', and 'let _ =' parts are not needed
rien has quit [Ping timeout: 246 seconds]
rien has joined #ocaml
ymasory has joined #ocaml
<TimurSoft>
edwin: sorry, what is "revised syntax"?
<edwin>
it is less error-prone than the original one IMHO
<TimurSoft>
cool, thank you all
<edwin>
at least the syntax error messages are a bit more correct (i.e. show a location that is closer to the error) than with the original syntax, which has some ambiguities
<adrien>
I don't like everything in the revised syntax, but I think some things are good, I'd like the half-revised syntax :P
<edwin>
so if you make an error, it could be either be here, or 10 lines before where you forgot the ;; to end a function
edwin has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
DOUK has joined #ocaml
<DOUK>
hello
<DOUK>
i have a problem with a function that should return the max of a list
<DOUK>
here i dont understand what value does a take
<DOUK>
can anyone help please
<adrien>
does it end up returning the *min* of the list?
vivanov has quit [Ping timeout: 276 seconds]
<DOUK>
oh wait
<adrien>
=)
<DOUK>
i had modified something to observe something
vivanov has joined #ocaml
<DOUK>
but i dont know what value a takes
<DOUK>
i wanted to see if i could find the min with that same function by changing the comparison operator
<DOUK>
but i still dont know what a is for
<adrien>
'a' is simply the max value of the list so far
<DOUK>
when does it take the max value?
<DOUK>
like assigning the max value x to a when x > a
<adrien>
it starts by being the max value of a list with a single element, then if the next element in the list is smaller, it doesn't change and if it's bigger, it becomes this new value, which means it is now the max of the first two elements of the list
<adrien>
repeat for each element until the end of the list and it'll be the max of all the elements of the list
<adrien>
I don't know if I'm making things clearer, it's a bit late and I'm falling asleep
<DOUK>
ok
<DOUK>
well i dont see where a = x in order to save the new max value
<adrien>
it's passed as a parameter
<adrien>
so it only lives in the parameters of the function
<DOUK>
oh wait
<DOUK>
| x::r -> max_list_bis r x ;;
<DOUK>
this line in the second part of the function
<DOUK>
is when a takes the value of the first element
<DOUK>
inside let max_list l =
<DOUK>
match l with
<DOUK>
[] -> failwith "empty"
<DOUK>
| x::r -> max_list_bis r x ;;
ygrek has quit [Ping timeout: 246 seconds]
<DOUK>
i see now
ymasory has quit [Quit: Leaving]
ikaros has quit [Quit: Leave the magic to Houdini]
temoto has joined #ocaml
<temoto>
Hello. Where can i find recommended ocaml project filesystem layout?
<thelema>
temoto: depends on the complexity of your project, but usually src/ holds your source files, doc/ holds documentation, maybe build/ holds build files, and . holds makefile/omakefile/myocamlbuild.ml
<thelema>
if you need to organize your source files better, use subdirs in src/
<temoto>
Same as in C.
<thelema>
pretty much.
<temoto>
Could you point considerations on choosing build tool makefile/omakefile/myocamlbuild.ml ?
<thelema>
make works for simple projects, although there's an ocamlmakefile that adds logic to deal with quite complex build requirements, omake works for a range of complexities, but is a bit nonstandard, and has its own programming language/paradigm
<thelema>
ocamlbuild is the new ocaml standard (distrbuted with ocaml itself) and is extended in ocaml, but works out of the box with a standardized myocamlbuild.ml and _tags file custom for your project to give external dependencies. Everything else is worked out pretty easily
<temoto>
Thanks.
ulfdoz has quit [Ping timeout: 240 seconds]
<thelema>
no problem.
<thelema>
do you know what you're going to build?
<TimurSoft>
Hello all, I have seen "open Syntax" on the top of a "main.ml", and in the same directory, there is a file "syntax.ml" , I would like to know which part of code (either in "syntax.ml" or makefile...) makes syntax a module so that I could be used in "main.ml"?
<temoto>
Yes. I'm going to start a new project to learn OCaml and build it.
<temoto>
TimurSoft, looks like no special syntax is required. It's just a capitalized filename without .ml suffix.
Oejet has quit [Ping timeout: 260 seconds]
<TimurSoft>
temoto: thank you, I see
TimurSoft has left #ocaml []
Amorphous has quit [Ping timeout: 240 seconds]
Amorphous has joined #ocaml
vivanov has quit [Read error: Connection reset by peer]