flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
Jeff_123 has joined #ocaml
Jeff_123 has quit []
<vixey> let rec x = 1 :: y and y = 1 :: x in x
<vixey> let rec x = 1 :: y and y = 1 :: x in x;;
<xavierbot> - : int list =
<xavierbot> [1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<vixey> palomer: yes it is possible
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
<xavierbot> 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1; 1;
seafood has quit [Read error: 54 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<palomer> whoa
<palomer> let rec id x = x and x = 1 :: id y and y = 1 :: id x in x;; <--why can't I write something like this?
<palomer> "This kind of expression is not allowed as right-hand side of `let rec'"
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
<vixey> palomer: I could guess for you
filp has quit ["Bye"]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]
<palomer> it seems you can't mix functions and values
<vixey> why might that be
<palomer> no clue
<vixey> my guess is side effects, but I don't know
seafood has quit []
bluestorm has joined #ocaml
lde has joined #ocaml
vixey has quit [Read error: 113 (No route to host)]
sporkmonger has joined #ocaml
coucou747 has joined #ocaml
lde has quit [Read error: 104 (Connection reset by peer)]
tsuyoshi has joined #ocaml
<palomer> let rec id x = x and x = 1 :: id y and y = 1 :: id x in x;;
<xavierbot> Characters 28-35:
<xavierbot> let rec id x = x and x = 1 :: id y and y = 1 :: id x in x;;
<xavierbot> ^^^^^^^
<xavierbot> This kind of expression is not allowed as right-hand side of `let rec'
<tsuyoshi> that expression makes my head hurt
bluestorm has quit [Remote closed the connection]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
Philonous1 has joined #ocaml
Philonous has quit [Connection timed out]
seafood has quit [Read error: 104 (Connection reset by peer)]
seafood has joined #ocaml
coucou747 has quit ["bye ca veut dire tchao en anglais"]
nuncanada has joined #ocaml
yziquel has quit [Read error: 110 (Connection timed out)]
<palomer> tsuyoshi, it's really easy
<palomer> ok, slightly easier
<palomer> let rec id x = x and x = 1 :: y and y = 1 :: id x in x;;
<xavierbot> Characters 43-50:
<xavierbot> let rec id x = x and x = 1 :: y and y = 1 :: id x in x;;
<xavierbot> ^^^^^^^
<xavierbot> This kind of expression is not allowed as right-hand side of `let rec'
<palomer> does lazy evaluation get around this?
<palomer> I'm compiling into ocaml
<palomer> ok
<palomer> laziness helps me get around this
ygrek has joined #ocaml
nuncanada has quit [Remote closed the connection]
seafood_ has joined #ocaml
<palomer> I hate it when things just work
<palomer> where's the pain and toil??!?
<palomer> makes a man want to give up
<palomer> I write some ugly code
<palomer> and it just works
<palomer> bleh
seafood_ has quit []
code17 has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
code17 has quit [Remote closed the connection]
code17 has joined #ocaml
code17 has quit [Remote closed the connection]
code17 has joined #ocaml
seafood has joined #ocaml
Jeff_123 has joined #ocaml
Asmadeus has joined #ocaml
Jeff_123 has quit []
seafood has quit [Read error: 60 (Operation timed out)]
seafood has joined #ocaml
Jeff_123 has joined #ocaml
Jeff_123 has quit []
filp has joined #ocaml
ygrek has quit [Remote closed the connection]
wolgo has left #ocaml []
besiria has joined #ocaml
ygrek has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
ozzloy has quit [clarke.freenode.net irc.freenode.net]
rog1 has quit [clarke.freenode.net irc.freenode.net]
Ugarte has quit [clarke.freenode.net irc.freenode.net]
mbishop has quit [clarke.freenode.net irc.freenode.net]
bla has quit [clarke.freenode.net irc.freenode.net]
mattam has quit [clarke.freenode.net irc.freenode.net]
ppsmimou has quit [clarke.freenode.net irc.freenode.net]
toxygen has quit [clarke.freenode.net irc.freenode.net]
besiria has quit [clarke.freenode.net irc.freenode.net]
Toonto_del_alma has quit [clarke.freenode.net irc.freenode.net]
xavierbot has quit [clarke.freenode.net irc.freenode.net]
Theq629 has quit [clarke.freenode.net irc.freenode.net]
fremo has quit [clarke.freenode.net irc.freenode.net]
rogo has quit [clarke.freenode.net irc.freenode.net]
petchema has quit [clarke.freenode.net irc.freenode.net]
Oatschool has quit [clarke.freenode.net irc.freenode.net]
Demitar has quit [clarke.freenode.net irc.freenode.net]
Philonous1 has quit [clarke.freenode.net irc.freenode.net]
Apocalisp has quit [clarke.freenode.net irc.freenode.net]
mfp has quit [clarke.freenode.net irc.freenode.net]
jonafan has quit [clarke.freenode.net irc.freenode.net]
xevz has quit [clarke.freenode.net irc.freenode.net]
jeremiah has quit [clarke.freenode.net irc.freenode.net]
Sparkles has quit [clarke.freenode.net irc.freenode.net]
pattern has quit [clarke.freenode.net irc.freenode.net]
sbok has quit [clarke.freenode.net irc.freenode.net]
shortc|desk has quit [clarke.freenode.net irc.freenode.net]
MelanomaSky has quit [clarke.freenode.net irc.freenode.net]
ulfdoz has quit [clarke.freenode.net irc.freenode.net]
sporkmonger has quit [clarke.freenode.net irc.freenode.net]
Morphous has quit [clarke.freenode.net irc.freenode.net]
netx has quit [clarke.freenode.net irc.freenode.net]
szell has quit [clarke.freenode.net irc.freenode.net]
det has quit [clarke.freenode.net irc.freenode.net]
hcarty has quit [clarke.freenode.net irc.freenode.net]
jdev has quit [clarke.freenode.net irc.freenode.net]
Hadaka has quit [clarke.freenode.net irc.freenode.net]
flux has quit [clarke.freenode.net irc.freenode.net]
filp has quit [clarke.freenode.net irc.freenode.net]
palomer has quit [clarke.freenode.net irc.freenode.net]
Smerdyakov has quit [clarke.freenode.net irc.freenode.net]
Mr_Awesome has quit [clarke.freenode.net irc.freenode.net]
munga has quit [clarke.freenode.net irc.freenode.net]
acatout has quit [clarke.freenode.net irc.freenode.net]
ygrek has quit [clarke.freenode.net irc.freenode.net]
code17 has quit [clarke.freenode.net irc.freenode.net]
smimou has quit [clarke.freenode.net irc.freenode.net]
ido has quit [clarke.freenode.net irc.freenode.net]
rwmjones has quit [clarke.freenode.net irc.freenode.net]
Axioplase_ has quit [clarke.freenode.net irc.freenode.net]
r0bby has quit [clarke.freenode.net irc.freenode.net]
Lalu has quit [clarke.freenode.net irc.freenode.net]
tsuyoshi has quit [clarke.freenode.net irc.freenode.net]
pango_ has quit [clarke.freenode.net irc.freenode.net]
authentic has quit [clarke.freenode.net irc.freenode.net]
Yoric[DT] has quit [clarke.freenode.net irc.freenode.net]
jlouis has quit [clarke.freenode.net irc.freenode.net]
kig has quit [clarke.freenode.net irc.freenode.net]
Associat0r has quit [clarke.freenode.net irc.freenode.net]
TaXules has quit [clarke.freenode.net irc.freenode.net]
ertai has quit [clarke.freenode.net irc.freenode.net]
haelix has quit [clarke.freenode.net irc.freenode.net]
jynxzero has quit [clarke.freenode.net irc.freenode.net]
cmeme has quit [clarke.freenode.net irc.freenode.net]
Asmadeus has quit [clarke.freenode.net irc.freenode.net]
bzzbzz has quit [clarke.freenode.net irc.freenode.net]
Camarade_Tux has quit [clarke.freenode.net irc.freenode.net]
ikatz has quit [clarke.freenode.net irc.freenode.net]
tab has quit [clarke.freenode.net irc.freenode.net]
svenl has quit [clarke.freenode.net irc.freenode.net]
asmanur has joined #ocaml
Yoric[DT] has joined #ocaml
ygrek has joined #ocaml
besiria has joined #ocaml
filp has joined #ocaml
Asmadeus has joined #ocaml
code17 has joined #ocaml
Philonous1 has joined #ocaml
tsuyoshi has joined #ocaml
sporkmonger has joined #ocaml
bzzbzz has joined #ocaml
Morphous has joined #ocaml
palomer has joined #ocaml
Camarade_Tux has joined #ocaml
jlouis has joined #ocaml
smimou has joined #ocaml
ido has joined #ocaml
pango_ has joined #ocaml
ozzloy has joined #ocaml
Apocalisp has joined #ocaml
sbok has joined #ocaml
kig has joined #ocaml
Smerdyakov has joined #ocaml
netx has joined #ocaml
rwmjones has joined #ocaml
Toonto_del_alma has joined #ocaml
Mr_Awesome has joined #ocaml
Associat0r has joined #ocaml
ulfdoz has joined #ocaml
xavierbot has joined #ocaml
Hadaka has joined #ocaml
szell has joined #ocaml
mfp has joined #ocaml
rog1 has joined #ocaml
shortc|desk has joined #ocaml
MelanomaSky has joined #ocaml
ikatz has joined #ocaml
Theq629 has joined #ocaml
Axioplase_ has joined #ocaml
r0bby has joined #ocaml
authentic has joined #ocaml
fremo has joined #ocaml
jonafan has joined #ocaml
det has joined #ocaml
Oatschool has joined #ocaml
mbishop has joined #ocaml
munga has joined #ocaml
ppsmimou has joined #ocaml
hcarty has joined #ocaml
jdev has joined #ocaml
xevz has joined #ocaml
acatout has joined #ocaml
flux has joined #ocaml
svenl has joined #ocaml
jynxzero has joined #ocaml
haelix has joined #ocaml
ertai has joined #ocaml
TaXules has joined #ocaml
tab has joined #ocaml
cmeme has joined #ocaml
bla has joined #ocaml
toxygen has joined #ocaml
mattam has joined #ocaml
Ugarte has joined #ocaml
petchema has joined #ocaml
Demitar has joined #ocaml
rogo has joined #ocaml
pattern has joined #ocaml
jeremiah has joined #ocaml
Sparkles has joined #ocaml
Lalu has joined #ocaml
MelanomaSky has quit [Read error: 113 (No route to host)]
filp has quit ["Bye"]
* Yoric[DT] 's boss is full of humor.
code17 has quit [Remote closed the connection]
code17 has joined #ocaml
<jlouis> heh!
jlouis has quit ["Leaving"]
ygrek has quit [Remote closed the connection]
jlouis has joined #ocaml
zhoupp has joined #ocaml
ygrek has joined #ocaml
zhoupp has quit [Success]
asmanur_ has joined #ocaml
code17 has quit [Remote closed the connection]
code17 has joined #ocaml
asmanur has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
bla has quit [Read error: 110 (Connection timed out)]
asmanur_ has quit [Read error: 110 (Connection timed out)]
asmanur_ has joined #ocaml
asmanur__ has joined #ocaml
vixey has joined #ocaml
bluestorm has joined #ocaml
asmanur_1 has joined #ocaml
asmanur has quit [Connection timed out]
asmanur_1 has quit [Read error: 60 (Operation timed out)]
code17 has quit [Remote closed the connection]
seafood has joined #ocaml
code17 has joined #ocaml
asmanur_ has quit [Read error: 110 (Connection timed out)]
code17 has quit [Remote closed the connection]
code17 has joined #ocaml
Associat0r has quit []
asmanur__ has quit [Read error: 110 (Connection timed out)]
asmanur has joined #ocaml
asmanur_ has joined #ocaml
asmanur__ has joined #ocaml
Ched- has joined #ocaml
Ched- has quit [Remote closed the connection]
asmanur has quit [Connection timed out]
code17 has quit [Remote closed the connection]
bluestorm has quit [Read error: 104 (Connection reset by peer)]
bluestorm has joined #ocaml
code17 has joined #ocaml
Philonous1 has quit [Client Quit]
Philonous has joined #ocaml
asmanur_ has quit [Read error: 110 (Connection timed out)]
seafood has quit []
asmanur__ has quit [Connection timed out]
<hcarty> bluestorm: ping
<bluestorm> pong
<bluestorm> argh
<bluestorm> i have a vague (rememberance ?) of silly things i might have saids some days ago :-'
<hcarty> A seemingly-working "1 |> float_of_int |> print_float" --> "print_float (float_of_int 1)" : http://ocaml.pastebin.com/m69d29276
<hcarty> And also "print_float |< float_of_int |< 1" --> (same as above)
<bluestorm> hm
<hcarty> bluestorm: I'm not taking you up on your offer for help, don't worry about that :-)
<hcarty> Not yet anyway
<bluestorm> i'm not sure this is the right way to go
<hcarty> I agree!
<bluestorm> i'd have used a Filter
<bluestorm> using a map over the already-parsed AST to spot the ((|>) a b) parts
<hcarty> I'm still far from understanding the details of camlp4, and I doubt I will have time in the near term to become familiar with it
<bluestorm> i think this technique is less inclusive (no risk of keywords cluttering) and more easily translatable into a pa_do plugin eventually
<hcarty> The pa-do folks have also extended pa_infix to support transformations like this
<bluestorm> hm
<hcarty> I'm looking through that now
<hcarty> The above pastebined code was written yesterday evening, before they emailed me about the pa_infix update
<bluestorm> did they had to update something ?
<bluestorm> i thought i had seen a function powerful enough for that
<hcarty> Yes, they said that it was outside of their original plan but that it only required a small update
<hcarty> They added the update and a |> example
<bluestorm> (do you know if there is a pertinent mailing-list ?)
<hcarty> I don't think so. Just the bzr logs
<bluestorm> ok
<bluestorm> the ideal API should allow you to plug a (function <:expr< (|>) $a$ $b$ >> -> <:expr< $b$ $a$ >> | other -> other) somewhere and that's it
<hcarty> http://ocaml.pastebin.com/m513efb98 -- this is the pa-do/pa_infix version
<bluestorm> that's weird
<bluestorm> hcarty: i guess the added thing is the ~expr label ?
<hcarty> bluestorm: Yes
<rwmjones> bluestorm, have you built recursive functions in camlp4, like 'let a () = ... and b () = ...' ?
<rwmjones> for some reason, I'm not seeing it here: http://brion.inria.fr/gallium/index.php/Abstract_Syntax_Tree
<bluestorm> hm
<bluestorm> i think i have
<bluestorm> syntaxically it's
<bluestorm> let (rec) [a = ... and b = ... and ..]
<bluestorm> the bracketed part being a binding
<rwmjones> ah right, bindings
<rwmjones> I see them now
<rwmjones> thanks :-)
<bluestorm> haha hcarty
<bluestorm> they actually removed the function i was thinking of
vixey has quit ["Leaving"]
<bluestorm> ("wth, i'm pretty sure there was something there !")
vixey has joined #ocaml
<hcarty> bluestorm: Does the ~expr functionality provide something similar?
<bluestorm> yes
<bluestorm> but hm
<bluestorm> i have the impression that pa_infix is the wrong place for such functionalities
<bluestorm> pa_infix is for syntaxic refinement of the operators while we're interested in a much more general "inlining facility" (wich could be specialized to infix notations if this is a common case, but still)
<bluestorm> in particular
<bluestorm> if i want to transform the (*) application in a particular case (say matrix multiplication), won't the "forbidden operators modifaction" feature of pa_infix get in my way ?
<bluestorm> (argh, i should probably write ( * ) )
<hcarty> bluestorm: I think the authors would suggest using the delimited overloading portion
<bluestorm> yes
<bluestorm> that's the diff that removed my beloved api function
<bluestorm> and actually, added at the same time easier to use functions providing the same features
<bluestorm> hcarty: i guess the authors make better decisions than me about were they want to place the features
<bluestorm> but i would still suggest to build something upon this "constants" function, instead of the strange ?expr label in pa_infix
<bluestorm> we could even write some proof-of-concept code right now
<bluestorm> hcarty: an other advantage is that it would provide the base for other class of "commonly used transformations" than infixes
<hcarty> bluestorm: Sounds good. This is getting to be somewhat beyond my camlp4 understanding, but I'm happy to learn more
<bluestorm> (eg. bind/return in a monad)
<bluestorm> hm
<bluestorm> haven't you used Ast.map yet ?
<bluestorm> you should absolutely try that, it's real fun
<bluestorm> (and Ast.fold of course)
<hcarty> No - my camlp4 experience so far only extends to modifying others' code
<bluestorm> well i could probably find you some Ast.map-using code of mine
<bluestorm> hm, failure
<bluestorm> hcarty: have you managed to compile and run the example they sent you ?
<hcarty> bluestorm: Yes, and it works as expected
<hcarty> It's in the examples/ directory, pa_compos.ml
<bluestorm> ah, interesting
<bluestorm> thanks
<hcarty> Adding a (|<) worked similarly
bla has joined #ocaml
* rwmjones has used Ast.map ...
<rwmjones> in ocaml-gettext
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
smimou has quit [Remote closed the connection]
smimou has joined #ocaml
<bluestorm> hm
<bluestorm> apparently, not having slept for 32 hours does not help with camlp4 transformations
<hcarty> bluestorm: I imagine that could affect mental function
<Camarade_Tux> he's training for the icfp contest ;)
<Smerdyakov> How do the ICFP contests manage to be so off-topic these last years, I ask ya?
<bluestorm> hcarty: http://pastebin.be/13197 barely does what i want
<bluestorm> it somewhat works : you have to put the code inside Foo.(...), and it doesn't handle nested transformations, ie. a |> b is right but a |> b |> c fails
<bluestorm> hm
<bluestorm> moreover, i've discovered a code line that i strongly suspect to contain a mistake, but i don't understand the intended effect of the things manipulated in that place, and my argument is mostly based on aesthetical considerations
<bluestorm> (it's the ops_transf case of the Delimited_overloading.concat function)
<bluestorm> this function has no effect on the code i use anyway, but it is a bit confusing
<bluestorm> (around some non-trivial functional stuff and lack of sleep)
coucou747 has joined #ocaml
besiria has quit [Remote closed the connection]
rwmjones has quit ["Closed connection"]
bohanlon has joined #ocaml
Demitar has quit [Read error: 110 (Connection timed out)]
lde has joined #ocaml
Demitar has joined #ocaml
ikatz has quit [Read error: 110 (Connection timed out)]
Anarchos has joined #ocaml
Anarchos has quit [Client Quit]
besiria has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
ygrek has quit [Remote closed the connection]
Associat0r has joined #ocaml
bluestorm has quit [Remote closed the connection]
ikatz has joined #ocaml
comglz has joined #ocaml
Theq629 has quit [Client Quit]
jlouis has quit ["Leaving"]
code17 has quit ["Leaving."]
code17 has joined #ocaml
Axioplase has joined #ocaml
besiria has quit [Remote closed the connection]
Morphous is now known as Amorphous
code17 has quit ["Leaving."]
Yoric[DT] has quit ["Ex-Chat"]
roy_hu has joined #ocaml
Asmadeus has quit ["nighters"]
hnr has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
comglz has quit ["Lost terminal"]