<thelema>
hcarty: you call it API, I call it static files in preset locations
<thelema>
I'm still staying in ste simple to mirror and client-doing dep calculations world
<thelema>
s/ste/the/
drunK has quit [Remote host closed the connection]
oriba has quit [Quit: Verlassend]
ztfw has quit [Remote host closed the connection]
rien_ is now known as rien
mal`` has quit [Ping timeout: 264 seconds]
mal`` has joined #ocaml
surikator has joined #ocaml
lopex has quit []
Oejet has left #ocaml []
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
arubin has joined #ocaml
enthymeme has joined #ocaml
rien is now known as rien|sleeping
rien|sleeping has quit [Quit: meh]
arubin has quit [Quit: arubin]
ulfdoz has joined #ocaml
tauntaun has quit [Quit: Ex-Chat]
myu2 has joined #ocaml
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
surikator has quit [Quit: surikator]
bacam has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Ping timeout: 276 seconds]
Yoric has joined #ocaml
ikaros has joined #ocaml
edwin has joined #ocaml
philtor has quit [Ping timeout: 272 seconds]
Cyanure has joined #ocaml
lpereira has joined #ocaml
enthymeme has quit [Quit: noswaith dda]
lpereira has quit [Quit: Leaving.]
Yoric has quit [Quit: Yoric]
bacam has joined #ocaml
magthe has joined #ocaml
Fullma has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
ikaros has joined #ocaml
bacam has quit [Quit: reboot]
bacam has joined #ocaml
Yoric has joined #ocaml
bacam has quit [Read error: No route to host]
myu2 has quit [Remote host closed the connection]
bacam has joined #ocaml
myu2 has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
jdavis has quit [Ping timeout: 260 seconds]
myu2 has quit [Remote host closed the connection]
myu2 has joined #ocaml
kaustuv has quit [Read error: Connection reset by peer]
kaustuv_ has joined #ocaml
jdavis has joined #ocaml
SoftTimur has joined #ocaml
<SoftTimur>
hello all, is there a function to return a type of a value?
<f[x]>
no
Oejet has joined #ocaml
<flux>
softtimur, in run time, there is no (exact) information on types
ftrvxmtrx has joined #ocaml
sepp2k has joined #ocaml
Derander has quit [Ping timeout: 250 seconds]
avsm has joined #ocaml
Derander has joined #ocaml
<SoftTimur>
thank you for the info
_andre has joined #ocaml
lopex has joined #ocaml
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
<SoftTimur>
hello all, is there a basic function of List to check if a given element exist in a given list?
<mrvn>
# List.mem;;
<mrvn>
- : 'a -> 'a list -> bool = <fun>
<SoftTimur>
mrvn: thank you...
<magthe>
gildor_: is there some way of getting oasis to create a META entry of type 'archive(syntax, preprocessor)'?
<magthe>
gildor_: I found the XMETAType on my own :)
<SoftTimur>
hello all, is there a basic function of List to see if a given list has elements which appear more than 1 time?
<SoftTimur>
or, is there a function to see how many times a given element appear in a given list?
oriba has joined #ocaml
<mrvn>
no. Insert them into a set or hashtbl and count.
<flux>
or use List.filter and List.length..
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
<thelema>
SoftTimur: Using batteries, this code works on an enum: Enum.fold (fun acc x -> Map.modify_def 0 x (fun cnt -> cnt + 1) acc) Map.empty e
<SoftTimur>
thank you all
Snark has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
BiDOrD_ has quit [Ping timeout: 264 seconds]
avsm has quit [Read error: Operation timed out]
kiyoto has joined #ocaml
kiyoto has left #ocaml []
avsm has joined #ocaml
ztfw has joined #ocaml
myu2_ has joined #ocaml
myu2 has quit [Ping timeout: 260 seconds]
fabjan has joined #ocaml
joewilliams_away is now known as joewilliams
myu2_ has quit [Remote host closed the connection]
Oejet has quit [Quit: Leaving.]
bohanlon has joined #ocaml
boscop has joined #ocaml
Oejet has joined #ocaml
avsm has quit [Quit: Leaving.]
ftrvxmtrx has quit [Remote host closed the connection]
boscop has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
boscop has joined #ocaml
oriba has quit [Ping timeout: 264 seconds]
oriba has joined #ocaml
ftrvxmtrx has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
Oejet has quit [Quit: Leaving.]
avsm has joined #ocaml
oriba has quit [Quit: Verlassend]
philtor has joined #ocaml
yezariaely has joined #ocaml
Yoric has quit [Quit: Yoric]
ftrvxmtrx has quit [Quit: Leaving]
magthe has quit [Quit: Going away]
myu2 has joined #ocaml
lopex has quit []
lopex has joined #ocaml
<hcarty>
thelema: Perhaps I misunderstood. I thought you meant you wanted to be able to query the full dependency tree of a package from a remote server
<thelema>
hcarty: yes, in multiple steps
<thelema>
although it'd certainly be possible to have the full dep tree of each package precomputed and stored in a text file
<hcarty>
thelema: The dependency tree would be created by the author then, before uploading to a remote server?
<thelema>
well, the META file could be scanned on upload and the full tree created from all the META files
<hcarty>
thelema: That still requires an understanding of dependencies on the server. It would be simpler to leave all of that to the client - in this case the upload client, as opposed to the end-user download client.
<thelema>
agreed, only one level of the deps needs to be extracted on the server
<thelema>
just the immediate deps
<thelema>
hmm, odd... my META file for batteries hasn't been rebuilt since 1.1.0
<thelema>
apparently there's something funny with the myocamlbuild.ml rule
<SoftTimur>
hello all, I have a very basic question... in "let t = something in body", can we change the value t in the body?
ftrvxmtrx has joined #ocaml
<thelema>
SoftTimur: two ways: rebinding t and using a ref
ygrek has joined #ocaml
<thelema>
let t = 1 in ... let t = 2 in ...
<thelema>
or let t = ref 1 in ... t := 2; ...
<SoftTimur>
I actually want to do something very simple, for instance something in C: sum = 0 // for i = 1 to 100 // s = s + 1, I am not sure how to do that in Ocaml...
<thelema>
let sum = ref 0 in for i = 1 to 100 do sum := !sum + 1; done
<SoftTimur>
thelema: is it a classical way? we use ref quite often in ocaml?
<thelema>
SoftTimur: no, the classical way is to do : let rec loop i sum = if i > 100 then sum else loop (i+1) (sum+1) in loop 1 0
<SoftTimur>
thelema: well, they recursive everything in caml... need to get used to it... thank you
<thelema>
the ocaml compiler will produce almost the same code for the recursive function as the for loop
<SoftTimur>
thelema: loop seems to me more natural, do not know if it is a result of education or what...
<thelema>
the second becomes more and more natural the more you use ocaml
<thelema>
s/the second/recursion
tauntaun has quit [Ping timeout: 276 seconds]
enthymeme has joined #ocaml
<SoftTimur>
hello, by using "export OCAMLRUNPARAM=b", i could backtrace when there is an exception. Does anyone know how to remove this option?
<adrien>
"unset OCAMLRUNPARAM"?
<adrien>
I also tend to use it like:
<adrien>
OCAMLRUNPARAM=b ./a.out
<adrien>
so it's local to the process
<SoftTimur>
adrien: thank you...
eaburns has joined #ocaml
<eaburns>
Can anyone explain how camlp4 grammars deal with recursion?
<eaburns>
I have a very simple production: X_star: [ [ x = x; xs = SELF -> x :: xs | -> [] ] ];
<eaburns>
this seems run out of stack space for very large inputs
<eaburns>
however, if I move the 'SELF' to the left-hand side it does not (however now my list is in reverse order)
avsm has quit [Quit: Leaving.]
<thelema>
eaburns: maybe add a List.rev to the end.
ulfdoz has joined #ocaml
<eaburns>
Yeah, I do that now but it is a bit annoying to have to add a production that just parses X_star_rev and reverses it. Additionally that's an additional traversal over my very long input
Snark has quit [Quit: Ex-Chat]
<thelema>
not over the input, but over the pointers in the list, but I get your point.
<eaburns>
sure, I mean, its not soo bad (being able to actually parse the file is better than a segfault). I was just curious if there was some simple trick that I could use to make the right-recursion tail-recursive
<thelema>
not that I know of, but I'm no camlp4 expert (or even beginner)
<mrvn>
eaburns: You can cheat and append to the end of a list.
<eaburns>
that is not tail-recursive
<thelema>
mrvn: it is, it's just not efficient
<mrvn>
you can write it tail recursive and the cheating is the efficient part.
<eaburns>
mrvn: what do you mean?
<mrvn>
You have your tail recursive code that builds the list in reverse, right?
<eaburns>
yes
<mrvn>
Now, instead of prepend to the list you append to the list. To make this efficient you need to pass along the last element of the list and modify that with Obj.* functions. That is the cheating part.
<eaburns>
haha, I see
<thelema>
There is a batteries function that's already tested to do the append properly, iirc
<thelema>
hmm, maybe not...
<mrvn>
Only ever do that with a list you creat internaly. Never with one that code outside might have access to.
<mrvn>
thelema: some battery functions do this internaly afaiks.
<thelema>
yes, it's done internally, it looks like it's not shared in the interface
<mrvn>
wouldn't be save.
<mrvn>
The list type is not ment to be modified and code assumes that.
Oejet has quit [Ping timeout: 240 seconds]
createsoftware has joined #ocaml
createsoftware has quit [Client Quit]
Oejet has joined #ocaml
mikemc has quit [Ping timeout: 272 seconds]
explodus has quit [Ping timeout: 276 seconds]
sepp2k has quit [Ping timeout: 276 seconds]
schmrkc has quit [Ping timeout: 240 seconds]
Oejet has quit [Ping timeout: 240 seconds]
benthos has quit [Ping timeout: 240 seconds]
schmrkc has joined #ocaml
schmrkc has quit [Changing host]
schmrkc has joined #ocaml
benthos has joined #ocaml
Oejet has joined #ocaml
mikemc has joined #ocaml
tauntaun has joined #ocaml
sepp2k has joined #ocaml
Oejet has quit [Ping timeout: 240 seconds]
Oejet has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
tauntaun has quit [Quit: Ex-Chat]
Obfuscate has quit [Ping timeout: 240 seconds]
explodus has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
Oejet has quit [Ping timeout: 240 seconds]
boscop has joined #ocaml
Oejet has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
victor_ has joined #ocaml
victor_ has left #ocaml []
_andre has quit [Quit: leaving]
Oejet has quit [Ping timeout: 240 seconds]
drunK has joined #ocaml
Oejet has joined #ocaml
Fullma has quit [Quit: Fullma]
<SoftTimur>
hello all, a very basic question... why does caml allow a sequence of codes (seperated by ';') after "let ... = ... in", while it does not allow a sequence of codes after "if ... then" (we need to add "begin ... end" here).
SoftTimur has quit [Remote host closed the connection]
lamawithonel_ has joined #ocaml
lamawithonel has quit [Ping timeout: 264 seconds]
SoftTimur has joined #ocaml
<SoftTimur>
I just logged out and logged in... did somebody react on my earlier question?
<hcarty>
SoftTimur: IIRC, ; has a lower precedence than if/then
<mrvn>
SoftTimur: Just put the if at the last element of the sequenze
<SoftTimur>
hcarty: thanks for the link, yes, I think precedence explains the thing
<SoftTimur>
thank you
ygrek has quit [Ping timeout: 240 seconds]
eye-scuzzy has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
yezariaely has joined #ocaml
bohanlon has quit [Ping timeout: 246 seconds]
<thelema>
the really tricky bit is how this is allowed: if x then let y = 5 in x();y else let y = 6 in x();y
<mrvn>
what is tricky there?
<mrvn>
Error: This expression is not a function; it cannot be applied
<mrvn>
x is a bool
<thelema>
the really tricky bit is how this is allowed: if x then let y = 5 in ignore();y else let y = 6 in ignore();y
<adrien>
I managed to notice whenever I use a semi-colon inside if-then-else and use parens or begin ... end
<mrvn>
IF <expression> then <let-expression> else <let-expression>
<thelema>
yes, I know, but the let-expression can have ; in it, while the then/else can't
<thelema>
in this case, "ignore(); 5" is different from "let y = 5 in ignore(); 5"
<thelema>
err, "; y"
<thelema>
or even "let () = () in foo" is different from "foo"
eye-scuzzy has joined #ocaml
<mrvn>
let has a hidden begin/end.
<thelema>
yes, but if/then can't have a hidden begin/end
Cyanure has quit [Remote host closed the connection]
<mrvn>
it could. It just doesn't. If it had then you would have to write begin if x then foo (); end; bla ()
<_habnabit>
I can't seem to get ocamldebug to show the contents of my own program's source files. It'll show stdlib stuff just fine.
<thelema>
let () = if x then foo () in bla()
<_habnabit>
What directory does -I want?
<thelema>
_habnabit: -g?
<_habnabit>
#1 Pc : 434272 Mokaphy_cluster char 3238
<_habnabit>
No source file for Mokaphy_cluster.
<_habnabit>
^ this is what I'm seeing. It seems to be compiled with -g.
<thelema>
-I is directory to object files, IIRC
<_habnabit>
I just don't know what I need to pass to -I to make it happy. I tried the _build directory and the regular source directory
<_habnabit>
(using ocamlbuild.)
<thelema>
pass both -I src/_build and -I src/
<_habnabit>
Oh, hah, never mind. Passing it /just/ the path to _build did it.
<_habnabit>
I was passing it a directory within _build before.
ulfdoz has quit [Read error: Operation timed out]
seafood has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
Obfuscate has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Ping timeout: 240 seconds]
yezariaely has quit [Quit: Leaving.]
<SoftTimur>
hello all, I would like to catch any exception of a piece of code, and do something in case of exception... do you know how to realize that? is there a key word like "else" or "others"?
<thelema>
try ... with _ -> ...
<SoftTimur>
thelema: cheers:)
sepp2k has joined #ocaml
boscop has joined #ocaml
<SoftTimur>
"try (a;b) with _ -> ...", so if a raises an exception, will b be executed?
<adrien>
no
<adrien>
b won't be executed
<SoftTimur>
adrien: cool
<SoftTimur>
guys, actually caml does not allow me to do "try a with ..." where a is a function returning a value instead of unit. Do I have to do "try let xxx = a in () with ..."?
<thelema>
your try and catch have to return the same value
<thelema>
same type
<thelema>
if your catch returns unit, your try code must return unit.
<thelema>
the easiest way to return unit is by using the ignore function
<thelema>
but if the enclosing code is expecting a value, you'll have to figure out what to do in your catches
<SoftTimur>
ok, I will use "try ignore(a) with ...", thanks
<jonafan>
you could also use the option type and return None in the catch portion
<jonafan>
and Some retval in the try portion
edwin has quit [Remote host closed the connection]
seafood has quit [Quit: seafood]
joewilliams is now known as joewilliams_away
Amorphous has quit [Ping timeout: 260 seconds]
mnabil has joined #ocaml
Amorphous has joined #ocaml
SoftTimur has quit [Remote host closed the connection]
Yoric has quit [Quit: Yoric]
eye-scuzzy has quit [Read error: Operation timed out]
boscop has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
SoftTimur has joined #ocaml
<SoftTimur>
hello all, if you are still there... do you think "try" consider "Error.error" is a exception?