gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0 http://bit.ly/aNZBUp
oriba has joined #ocaml
oriba has quit [Client Quit]
rks has quit [Quit: dodo]
gnuvince_ has quit [Quit: ""]
rwmjones has quit [Ping timeout: 245 seconds]
drunK has quit [Remote host closed the connection]
philtor has joined #ocaml
joewilliams_away has quit [Excess Flood]
joewilliams has joined #ocaml
joewilliams is now known as joewilliams_away
Amorphous has quit [Ping timeout: 260 seconds]
Amorphous has joined #ocaml
philtor has quit [Quit: Leaving]
<sohum> how do I use Option.get?
<sohum> I keep getting "Unbound value Option.get" or "Unbound module Option"
mikemc has quit [Read error: Connection reset by peer]
jonathandav has quit [Read error: Connection reset by peer]
mcclurmc has joined #ocaml
jonathandav has joined #ocaml
Edward_ has quit [Read error: Connection reset by peer]
metasyntax has joined #ocaml
roconnor has joined #ocaml
<roconnor> what is ld.conf?
roconnor has quit [Remote host closed the connection]
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
<orbitz> Arg makes soem really ugly helps creens
valross has quit [Quit: Ex-Chat]
<thelema> sohum: in batteries? Extlib? something else?
<sohum> thelema: ?
ikaros has joined #ocaml
rks has joined #ocaml
<kaustuv> orbitz: have you tried Arg.align?
<thelema> sohum: you were asking about Option.get
<sohum> thelema: yep. isn't that in the standard ocaml libraries?
<thelema> not so much
ikaros has quit [Quit: Leave the magic to Houdini]
<thelema> there's no Option module in the ocaml stdlib
<sohum> then what's http://ocaml-lib.sourceforge.net/doc/Option.html a reference for?
<thelema> an extended stdlib - here's the reference for ocaml: http://caml.inria.fr/pub/docs/manual-ocaml/index.html
<thelema> note part IV: the standard library
<sohum> oh, I see
<sohum> that's not confusing at all :P
Yoric has joined #ocaml
LionMade0fLions has joined #ocaml
LionMadeOfLions has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
Fullma has quit [Ping timeout: 245 seconds]
Yoric has quit [Quit: Yoric]
Man_of_Wax has quit [Ping timeout: 240 seconds]
ftrvxmtrx has quit [Quit: Leaving]
Man_of_Wax has joined #ocaml
rwmjones has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ftrvxmtrx has joined #ocaml
yezariaely has joined #ocaml
yezariaely has left #ocaml []
Yoric has joined #ocaml
_andre has joined #ocaml
yezariaely has joined #ocaml
th5 has joined #ocaml
avsm has quit [Quit: Leaving.]
stdDoubt has joined #ocaml
<stdDoubt> functions or object methods without arguments should always be defined like let funName () = (...)? is not possible to omit the "()" ?
<albacker> apparently yes i think : http://pastebin.com/arQJbUbf
avsm has joined #ocaml
rossberg has joined #ocaml
<rwmjones> stdDoubt: the story is really this: functions must have at least one parameter
<rwmjones> if you don't have any other parameters that you need to pass to the function, then you can pass a single unit parameter
<rwmjones> the unit parameter is written '()' with type 'unit'
<rwmjones> the reason that functions must have at least one parameter is so you can tell the difference between calling the function, and making a value which is a function
<rwmjones> object methods are a little bit different in ocaml though
<rwmjones> the method always has one implicit parameter (the pointer to the object)
<rwmjones> so you can define an object method without any explicit parameters: method foo = 1
<rwmjones> o#foo ===> 1
<rwmjones> but if you needed to pass around a reference to that method, you can't do that .. so in that case it is often done (particularly if the method has side-effects) that you define the method as method foo () = 1 anyway
<rwmjones> so o#foo and o#foo () are different
<stdDoubt> rwmjones: thanks
pheredhel has quit [Ping timeout: 264 seconds]
pheredhel has joined #ocaml
ttamttam has joined #ocaml
ski has joined #ocaml
ygrek has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
ski has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 245 seconds]
mfp has joined #ocaml
boscop_ is now known as boscop
rixed_ has joined #ocaml
yezariaely has left #ocaml []
Fullma has joined #ocaml
rwmjones has quit [Quit: Terminated with extreme prejudice - dircproxy 1.2.0]
rwmjones has joined #ocaml
rgrig has joined #ocaml
roconnor has joined #ocaml
<roconnor> what is ld.conf?
<julm> a file to look for dynamic libraries
<julm> ocaml has its own in /usr/lib/ocaml/ld.conf
<julm> and ld in /etc/ld.so.conf
<roconnor> julm: are ocaml dynamic libraries different from normal dynamic libraries
<julm> well, not in their format FWICS
<julm> they just contain code adapted to ocaml, I would say.
<julm> especially for the GC
<roconnor> julm: is /usr/lib/ocaml/ld.conf only used a compile time, or is it accessed at runtime by compiled programs?
<julm> runtime makes more sense, I would say
<roconnor> so when I compile an ocaml program, that code will have reference to /usr/lib/ocaml/ld.conf and if I rewrite that file the runtime behaviour of already compiled code could change?
<roconnor> oh thanks
<roconnor> I coudln't find this
<roconnor> julm: so ld.conf doesn't affect native compiled code?
<julm> ocamlopt has no -dllib option
Modius has quit [Quit: I'm big in Japan]
<roconnor> julm: okay. I'm not really trying to do anything. Just trying to understand OCAMLFIND_LDCONF.
<roconnor> julm: this has been very helpful
notk0 has joined #ocaml
<notk0> hello, how can I access the members of a function? d I have to do something as let fun {a=rec1; b= rec2...}= and then use them directly?
<julm> notk0: what do you call "members of a function"?
<notk0> juml for example this let norme {x=x;y=y;z=z}=let s=x*x+y*y+z*z in sqrt (float_of_int s);;
<notk0> why do I have to specify each term? why can't I just access them like in other languages
<julm> you can omit terms
<notk0> where type vecteur= { x:int; y:int: z:int}
<notk0> julm, if I don't do x=x; or x'=x; it gives me an error :|
<julm> let norme v = let s=v.x*v.x etc..
<notk0> I can do that?
<julm> sure
<notk0> wow thank you :P
<julm> but it is less optimal
<notk0> cause it has to access them everytime? I mean to deference the object?
<julm> btw, there is a syntactic sugar that enables to only write let norme {x;y;z} = let s=x*x etc..
<julm> yep, it fetches multiple type the content of v
<notk0> julm, to declare a type vecteur all I do is type {num1;num2;num3} ? cause that doesn't seem to work
<julm> not to declare the type; but to pattern match it in the parameter of the function
<notk0> I mean to create an instance of that type
<julm> not to instantiate; but to fetch its content
<notk0> oh nevermind according to the tutorial I have to tell it implicitly the access names
<julm> # type v = {x:int; y:int};;
<julm> type v = { x : int; y : int; }
<julm> # let f {x} = x;;
<julm> val f : v -> int = <fun>
<notk0> for me let norme {x;y;z;} gives a syntax error, I have to implicitly tell it x=x etc
<julm> your ocaml is too old
<notk0> maybe :P
<julm> sure
<notk0> 3.11.2
<julm> 3.13.0+dev0 (2010-06-07)
<flux> notk0, {x} in 3.12.0 is the same as {x=x} in an older ocaml
<notk0> well I'll have to use the older ocaml syntax then, thank you :P
<notk0> can you do {1;2;3} instead of {x=1;y=2;z=3} in the new ocaml?
<flux> no
<julm> no
<flux> you can however do let x, y, z = 1, 2, 3 in {x; y; z}
<notk0> oh I see, thank you
ttamttam has quit [Remote host closed the connection]
<orbitz> kaustuv: yeah, i'm usign Arg.align. The problem is it seems to take the first word from doc and put it next to your option in the help screen then align the words after that. The problem is it still does taht with binary options, which doesn't make sense.
mcclurmc has quit [Remote host closed the connection]
mikemc has joined #ocaml
joewilliams_away is now known as joewilliams
kerneis has quit [Ping timeout: 272 seconds]
kerneis has joined #ocaml
ski has joined #ocaml
ztfw has joined #ocaml
ccasin has joined #ocaml
Yoric has quit [Quit: Yoric]
hto has quit [Read error: Connection reset by peer]
hto has joined #ocaml
th5 has quit [Quit: th5]
ttamttam has joined #ocaml
<notk0> err, what is the problem with this? type objet=s of sphere | p of plan;; ?
yezariaely has joined #ocaml
<julm> notk0: you must use caps
<julm> type objet=S of sphere | P of plan;;
yezariaely has left #ocaml []
<notk0> julm, oh thank you, why such a bizarre need tho?
<julm> if later in your code you were to write [s something] it would take [s] for a function applied on [something]
<notk0> julm, oh I hate that about Ocaml, functions don't need braces, but not using them breaks the code, cause the interpreter doesn't correctly apply nested functions
boscop_ has joined #ocaml
<thelema> notk0: try [let (|>) x f = f x], it works wonders on my nested function problem
<notk0> thelema, I don't understand what that is supposed to do?
boscop has quit [Ping timeout: 245 seconds]
<thelema> x |> map ((*) 2) |> filter odd |> print Int.print stdout
<thelema> (batteries printing module assumed)
<julm> "map ((*) 2) |> filter odd" :O
<thelema> :)
<kerneis> notk0: tu es dans quel groupe de TD, juste par curiosité ?
<notk0> kerneis, la groupe d'aujourdhui
<notk0> kerneis, comment tu a su? :|
<kerneis> "type objet=s of sphere | p of plan;"
<notk0> XD hehe
<notk0> et toi?
ikaros has joined #ocaml
<kerneis> moi je suis chargé de TD du groupe de demain
<notk0> ok
<kerneis> et au passage, aucun problème pour moi que vous veniez chercher de l'aide sur IRC, tant que le sujet est fait en binôme, sérieusement
ygrek has joined #ocaml
<ski> notk0 : function applications don't need brackets, but you still need brackets for grouping, of course
<notk0> ski, yes, and that kinda defeats the purpose of not making them mandatory like other languages
<ski> i think it makes the language more uniform
<ski> it removes one extra special case for how brackets are used
<ski> (you would still need brackets for grouping, with infix operators .. this way, you don't also have to remember another use of them)
<notk0> right
<ski> (still, they are used for "turning an infix operator into an expression", so it doesn't remove *every* other use of brackets .. but it simplifies the picture)
<notk0> are records immutable ?
<mehdid> by default, yes
<mehdid> but you can define some (or all) fields as mutable
<notk0> oh ok, thank you mehdid
<mehdid> e.g. a reference has type: type 'a ref = { mutable contents: 'a }
rwmjones has quit [Ping timeout: 245 seconds]
ttamttam has quit [Remote host closed the connection]
drunK has joined #ocaml
rwmjones has joined #ocaml
ulfdoz has joined #ocaml
ulfdoz has quit [Read error: Connection reset by peer]
rgrig has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ygrek_ has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
init1 has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
notk0 has quit [Quit: Leaving]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
ulfdoz_ is now known as ulfdoz
Modius has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
yezariaely has joined #ocaml
yezariaely has left #ocaml []
_andre has quit [Quit: *puff*]
lpereira has joined #ocaml
Edward__ has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Client Quit]
ftrvxmtrx has joined #ocaml
init1 has quit [Quit: Quitte]
ztfw has quit [Remote host closed the connection]
solistic has joined #ocaml
solistic has left #ocaml []
ski has quit [Read error: Connection reset by peer]
BiDOrD_ has joined #ocaml
ftrvxmtrx has quit [Read error: Connection reset by peer]
BiDOrD__ has joined #ocaml
B1DOrD has quit [Ping timeout: 245 seconds]
ski has joined #ocaml
BiDOrD_ has quit [Ping timeout: 252 seconds]
avsm has quit [Quit: Leaving.]
ygrek_ has quit [Remote host closed the connection]
ftrvxmtrx has joined #ocaml
eelte has joined #ocaml
lpereira has quit [Quit: Leaving.]
coucou747 has quit [Ping timeout: 272 seconds]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 252 seconds]
ftrvxmtrx_ has quit [Client Quit]
ftrvxmtrx has joined #ocaml
roconnor has quit [Remote host closed the connection]
ccasin has quit [Quit: Leaving]
ulfdoz has quit [Read error: Operation timed out]
boscop_ is now known as bosocp
bosocp is now known as boscop
fraggle_ has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
tab has quit [Remote host closed the connection]
valross has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
elehack has joined #ocaml