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
khia0 has joined #ocaml
khia0 has left #ocaml []
lamawithonel has quit [Ping timeout: 255 seconds]
ulfdoz has quit [Read error: Operation timed out]
ikaros has quit [Quit: Leave the magic to Houdini]
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
lamawithonel has joined #ocaml
gnuvince has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 260 seconds]
Associat0r has joined #ocaml
Associat0r has quit [Ping timeout: 245 seconds]
Associat0r has joined #ocaml
Associat0r has quit [Quit: Associat0r]
mbac has quit [Ping timeout: 250 seconds]
sealion has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
jamii_ has joined #ocaml
sealion has quit [Remote host closed the connection]
jamii_ has quit [Ping timeout: 255 seconds]
gnuvince has quit [Remote host closed the connection]
gnuvince has joined #ocaml
gnuvince_ has quit [Remote host closed the connection]
gnuvince1 has joined #ocaml
rolfr has joined #ocaml
yezariaely has joined #ocaml
yezariaely has quit [Client Quit]
rolfr has quit [Client Quit]
ulfdoz has joined #ocaml
ski has quit [Read error: Connection reset by peer]
ski has joined #ocaml
Modius has quit [Ping timeout: 265 seconds]
init1 has joined #ocaml
init1 has quit [Read error: Connection reset by peer]
init1 has joined #ocaml
BiDOrD has quit [Ping timeout: 255 seconds]
ulfdoz has quit [Quit: brb]
ikaros has joined #ocaml
ulfdoz has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Quit: reboot]
Amorphous has quit [Ping timeout: 272 seconds]
mnabil has joined #ocaml
Amorphous has joined #ocaml
boscop_ is now known as boscop
DimitryKakadu has joined #ocaml
Anarchos has joined #ocaml
sdj has joined #ocaml
sdj has quit [Ping timeout: 260 seconds]
sdj has joined #ocaml
fons has joined #ocaml
<fons> Hi
<fons> quick question about ::
BiDOrD has joined #ocaml
<fons> I am coming from Haskell, in which : is an infix constructor
<fons> What is :: exactly in Ocaml
<fons> a constructor
<fons> a function
sdj has quit [Ping timeout: 240 seconds]
<fons> (infix operator)
<fons> or both
<Anarchos> fons a function, in infix notation
<fons> Anarchos: ok, but then, how can I pattern math against it if it´s just a function
<Anarchos> sorry, it is a constructor, you're right
<adrien> :: is sugar afaik
<fons> ok, that makes sense to certain extend
<fons> although I don't like the fact that :: is treated as a special case
<fons> in Haskell all data constructors are also functions and can be infix
<adrien> with +, you can also use (+) which is a function, but with ::, you don't have an equivalent
<fons> that's why I was confused
<fons> uhm and it is strange that you can actually redefine as an infix operator
<fons> it seems to be possible to write "let (::) a b = ...."
<ftrvxmtrx> it's possible, but only (::) will work then
<ftrvxmtrx> 1 :: [] will use the sugar
<fons> ok ftrvxmtrx, thanks
<fons> and sorry for the rant, but it seems a bit ugly
<fons> :)
<ftrvxmtrx> "let (::) a b = a :: b" :)
<fons> actually, wait, according to the documentation infix operators are not supposed to start with : , am I right?
<fons> the starting character should start with any of these
<fons> (= ∣ < ∣ > ∣ @ ∣ ^ ∣ | ∣ & ∣ + ∣ - ∣ * ∣ / ∣ $ ∣ %)
<fons> the starting character shoul _be_ any of these, sorry
<fons> that is confusing ...
<fons> would anyone care to clarify, please?
<fons> ftrvxmtrx: The resulting function from "let (::) a b = a :: b" is not an infix operator, is it? and then, then, if it's just a function, shouldn't it start with a letter?
<ftrvxmtrx> if it doesn't start with one of these chars, it won't work as infix operator
<ftrvxmtrx> yes, it's not infix
<fons> ftrvxmtrx: but function identifiers are supposed to start with a letter, right?
<ftrvxmtrx> not necessarily
<fons> how come? I am reading the lexer's grammar in the documentation, and it seems like it
<ftrvxmtrx> it also may start with undescore
<ftrvxmtrx> strangely I can't find it in the documentation :(
<ftrvxmtrx> "Underscore is considered a lowercase letter for this purpose."
<fons> but it doesn't mention : as a valid starting character for function names, see the definition of value-name
<fons> so either there is something wrong with my reasoning, or the implementation is not consistent with the documentation
<fons> otherwise :: would be rejected as a function name
<ftrvxmtrx> seems like "function" and "infix operator" is somewhat different then
<ftrvxmtrx> let :: a b = ... won't work
<ftrvxmtrx> but let (::) ... will
Snark has joined #ocaml
Anarchos has quit [Quit: reboot system]
sdj has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD__ has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
sdj has quit [Ping timeout: 240 seconds]
BiDOrD_ has quit [Ping timeout: 240 seconds]
ztfw has joined #ocaml
googi has joined #ocaml
DimitryKakadu has quit [Ping timeout: 240 seconds]
DimitryKakadu has joined #ocaml
Smerdyakov has joined #ocaml
Smerdyakov has left #ocaml []
cyounes has joined #ocaml
<fons> ok, the implementation of the compiler is definitively not consistent with the documentation when it comes to letting a function have :: as a name
<cyounes> hi
<fons> I don't know if it's worth filing a bug for such a stupid corner case
<fons> actually, toplevel does not accept "let (::) _ _ = 1 ;;"
cyounes has left #ocaml []
BiDOrD_ has joined #ocaml
googi has quit [Remote host closed the connection]
BiDOrD__ has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
mnabil has quit [Ping timeout: 265 seconds]
BiDOrD_ has quit [Ping timeout: 260 seconds]
<fons> but my program compiles and it´s redifining ::, strange
clog has joined #ocaml
palomer has joined #ocaml
aklt has joined #ocaml
cYounes has joined #ocaml
cYounes is now known as H4rdcLOwn
Edward has joined #ocaml
H4rdcLOwn has left #ocaml []
Snark has quit [Remote host closed the connection]
<flux> :: is a constructor
<flux> and a build-in for one
<flux> didn't know it could be re-defined, though
<flux> but that doesn't work with camlp4 :/
ztfw has quit [Remote host closed the connection]
gildor has quit [Ping timeout: 240 seconds]
gildor has joined #ocaml
DimitryKakadu has quit [Remote host closed the connection]
Anarchos has joined #ocaml
<palomer> you can also redefine true and false
<palomer> type foo = true of int
<flux> and array indexing
<palomer> that I didn't know
<palomer> what's the syntax?
<flux> by redefining the array-module :)
Edward has quit [Ping timeout: 245 seconds]
<flux> they map into Array.set/get
<palomer> ahh
sdj has joined #ocaml
<adrien> I remember a PR where defining an option type and/or None/Some broke other things
<palomer> that's strange
<palomer> internally, ocaml differentiates the built in option type from user defined option types
<adrien> ah, I think I had actually seen that one last month, my memory is getting away I guess =/
<adrien> 'problem with optional arguments when defining a type with a "Some of <type>" constructor' -> http://caml.inria.fr/mantis/view.php?id=5075
<palomer> hah, only took 10 years!
sdj has quit [Ping timeout: 272 seconds]
seafood has joined #ocaml
mfp has quit [Ping timeout: 245 seconds]
init1 has quit [Quit: Quitte]
Edward has joined #ocaml
mfp has joined #ocaml
seafood has quit [Ping timeout: 272 seconds]
ftrvxmtrx has quit [Ping timeout: 265 seconds]
ftrvxmtrx has joined #ocaml
sdj has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
thieusoai has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 240 seconds]
ikaros has quit [Quit: Leave the magic to Houdini]
Obfuscate has quit [Ping timeout: 250 seconds]
Obfuscate has joined #ocaml
sdj has quit [Ping timeout: 260 seconds]