rwmjones 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!)
olsner has quit ["Leaving"]
postalchris has quit [Read error: 110 (Connection timed out)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
ita has quit [Read error: 104 (Connection reset by peer)]
yminsky has quit [Read error: 110 (Connection timed out)]
benzo has quit []
benzo has joined #ocaml
<benzo> ok I have another rather basic question
<benzo> # let incr i = 1 + 1;;
<benzo> val incr : 'a -> int = <fun>
<benzo> whats the meaning of 'a' ?
<pango_> it's a type variable
<pango_> in this case it means that incr is a polymorphic function: you can give it an argument of any type for `i'
<pango_> # incr 3 ;;
<pango_> - : int = 2
<pango_> # incr 3.1416 ;;
<pango_> - : int = 2
<pango_> # incr "hello world" ;;
<pango_> - : int = 2
middayc_ has joined #ocaml
<benzo> I'm asking because of this tutorial
<benzo> page 6
<benzo> pango_, one thing that would help me
<benzo> could you maybe translate 'val incr : 'a -> int = <fun>' in to human english?
<pango_> incr is a function that takes a parameter of any type and returns an int
<benzo> and the type of incr is 'a ?
<benzo> sorry wrong
<pango_> the type of incr is 'a -> int
postalchris has joined #ocaml
postalchris has quit [Client Quit]
<benzo> could you explain that to me?
yminsky has joined #ocaml
<pango_> that's how the type of functions is written
<benzo> the meaning of 'a is "any type" ?
<pango_> yes... for example if you take the "identity function", that returns its argument
<pango_> # let id x = x ;;
<pango_> val id : 'a -> 'a = <fun>
<pango_> what the type of the function says is that the type of the returned value is the same as the type of the argument
<benzo> whats the function of '... = <fun>' ?
<benzo> I mean, whats the meaning
<pango_> it just mean that, in OCaml, functions are opaque values... so you can't see the definition of the function
middayc_ has quit []
middayc has joined #ocaml
<benzo> with definition you mean implementation ?
<pango_> yes
<pango_> compare with
<pango_> # 42 ;;
<pango_> - : int = 42
<pango_> where both type and value are available
<pango_> (for display, that is)
<benzo> what is my statement when I write '#42;;' ?
<pango_> it's not a statement, it's an expression
<benzo> "there is a value of '42" ?
<pango_> you ask for the evaluation of the expression 42
<pango_> which evaluates to 42
<benzo> and then ocaml transforms this into "there is a value of '42' with the type of int" ?
<pango_> yup... # "Hello World" ;;
<pango_> - : string = "Hello World"
<benzo> ah, ok I basically say "evaluate '42' for me"
<benzo> and then ocaml answers "the value '42' is of type 'int'"
<pango_> that's what the toplevel does
TheLittlePrince has quit [Client Quit]
<pango_> in a compiled program it would be less useful, because that evaluation does no side effect, and the value is not automatically displayed in compiled programs, like it is in the toplevel
<pango_> yet it would be legal
<benzo> but when I say # let id x = x ;;
<benzo> no wait
<benzo> one step back
<benzo> when I say # let x = 42;;
<benzo> toplevel answers: val x : int = 42
<benzo> that means " the value of the variable 'x' with the type of an 'int' is '42"
<benzo> correct?
seafood_ has joined #ocaml
<pango_> it means that the value 42 is bound to the identifier `x' (until the end of the current module)
<pango_> or, since you're not within a module, until you kill the toplevel ;)
<benzo> is there a diff between "identifier" and "variable"
<pango_> it means roughly that, from now on, everywhere you use `x', it's like if you used `42' instead
<pango_> you can't change the value bound to `x', like you can't change the value of `42' either
coucou747 has quit ["bye ca veut dire tchao en anglais"]
<pango_> # x + 17 ;;
<pango_> - : int = 59
<pango_> # 42 + 17 ;;
<pango_> - : int = 59
<pango_> same thing
<pango_> # if x > 17 then "yes" else "no" ;;
<pango_> - : string = "yes"
<pango_> etc..
<benzo> ah ok, and thus 'let x = 5548;;' makes somehow a new 'x' ?
<pango_> yes, that `shadows' the previous one
<benzo> its a bit like a coin - no?
<pango_> but if you used the previous one, say, in the definition of functions, those functions will still use the older definition of x
<benzo> one side the head (x) other side the number (42)
<pango_> I'm not sure it better explains what's going on
<benzo> yeah lets forget that
<pango_> personally, I read "let x = 42" like an hypothesis in mathematics... "let's say x = 42"... and then you can use 42 everywhere you see x
seafood_ has quit []
<pango_> but you usually don't have a notion of scope in mathematics like you do in programming languages
<benzo> you mean a function like: F(x)=x*x ?
<benzo> how do you read that in english ?
<Smerdyakov> pango_, you do in honest mathematics. ;-)
<benzo> sorry I'm german speakign
<pango_> mmmh, you're right, in such definition, `x' only exists in F definition
<benzo> swiss actually
<pango_> it's just that one would probably avoid using `x' freely everywhere and cause lots of confusion :)
<benzo> why so?
<pango_> for each instance of `x', you'd have to be careful about what x you're talking about
<pango_> compilers are better at those things than humans ;)
<benzo> because of the 'shading' ?
<benzo> sorry 'shadowing'
<benzo> pango_, you said before "...those functions will still use the older definition of x" what do you meant by that ?
<pango_> # let x = 42 ;;
<pango_> val x : int = 42
<pango_> # let incr i = i + x ;;
<pango_> val incr : int -> int = <fun>
<pango_> # let x = 17 ;;
<pango_> val x : int = 17
<pango_> # incr 13 ;;
<pango_> - : int = 55
<benzo> I still don't get it - you mean 'x' right?
<pango_> there's two `x' in above lines
<benzo> but you haven't use x after the second expression with 'x'
<pango_> the first one bound to 42, and a second one bound to 17
<benzo> when I write #x;;
<benzo> the result will be latest definition and not use the older definition like said
<pango_> correct, but the incr function still uses the first binding
<pango_> that's why incr 13 returns 55
<benzo> slapping my forehead
<benzo> another question
yminsky has quit [Read error: 110 (Connection timed out)]
<benzo> you said in toplevels definition: "val incr : int -> int = <fun>" the part ': int' means the argument
<pango_> yes
<benzo> can I force the argument type in the statement ?
<pango_> you mean, in the definition? You can narrow the type of a variable (vs. inferred type), that's all
<pango_> # let incr (i:string) = 1 + 1 ;;
<pango_> val incr : string -> int = <fun>
<pango_> here incr is no longer polymorphic
seafood_ has joined #ocaml
<benzo> sorry I struggle with the vocabulary # let x = 42 ;; is considered as a definition not statement?
<benzo> ah ok, I see
<pango_> I prefer the term definition
<benzo> ok
<pango_> the main different between definitions and expressions being that expressions have a value
<benzo> I've got a funny warning: http://pastebin.com/d39f15d9e
<pango_> s/different/difference/
<pango_> that's the same problem you had with your first program (; vs ;; or let vs let ... in)
<benzo> I understand that, the diff. between definition and statement is hard to understand.
<pango_> forget about statements, I'm not even sure there's anything that can be called that way in OCaml ;)
<benzo> ok
<benzo> regarding "(; vs ;; or let vs let ... in)"
<benzo> in my example I'm still in the same module
<pango_> what happened in the code you pasted is that OCaml evaluated let x = (989898; add 3)
<pango_> the value of a sequence of expressions is the value of the last expression
<benzo> oh Isee
<pango_> you got a warning because the value of the expression 989898 is not used
<pango_> and the x was bound to the value of add 3
<pango_> s/the/then/
<benzo> is there any use for such a sequence of expressions?
<benzo> is it sth like an array?
<pango_> # let x = Printf.printf "Debugging code\n";
<pango_> add 3 ;;
<pango_> Debugging code
<pango_> val x : int = 4
<pango_> # [| 3; 4; 17; 42 |] ;;
<pango_> - : int array = [|3; 4; 17; 42|]
<delamarche> benzo: It's a good idea to get rid of the idea of a 'statement' as quickly as you can :)
<delamarche> Like pango_ was implying, it's easier at first if you just think of everything as definitions
<delamarche> statements imply that you're sort of imperatively doing things in some order
<benzo> delamarche, thanks for the advice - I try to deprogram myself
<delamarche> What's your programming background, benzo?
<delamarche> I wrote a paper a couple of years ago on my experience switching from OOP to ocaml
<delamarche> it might help you, I dunno
<benzo> imparative languages :-)
<delamarche> ocaml really threw me for a loop when i first started learning it
<delamarche> and I had already played with scheme quite a bit
<delamarche> Have you done much object-oriented?
<benzo> "switching from OOP to ocaml" this would be defintely interesting
<benzo> pango_, "val x : int = 4" isn't there a ;; missing (please say yes)
<delamarche> In the toplevel you'd need that ;;
<delamarche> wait one sec
<pango_> benzo: what are you referring to? my last message before the array example?
<benzo> two lines after "debugging code"
<delamarche> I think he mistook your output statement as source
<benzo> ah damn it - sorry
<pango_> benzo: what I was trying to say is that sequences are useful when you use side-effects (imperative programming, I/O...)
<delamarche> benzo: If you're confused about statements, definitions, ; and ;;
<delamarche> look here
<delamarche> The meat of it begins at "Using and omitting ; and ;;"
<delamarche> uh reverse ; and ;; in that
<pango_> indeed you don't need sequences in purely functionnal code
<delamarche> in fact it's probably not a bad idea to go through every page on the ocaml tutorial and work through the examples
<delamarche> also, the caltech ocaml tutorial is quite good
<benzo> delamarche: thanks I already had it open, its good written
<benzo> but it although hard to understand - somehow
<delamarche> the content is a little scattered
<delamarche> like, it doesn't really start in one place and then progress
<delamarche> one sec i'm looking for something for you
<delamarche> oh wow hickey really expanded his book since the last time i looked
<delamarche> it's huge now!
AxleLonghorn has joined #ocaml
<benzo> delamarche, do you have an academic background?
<delamarche> Sort of
<delamarche> i finished a masters degree in computer science about 6 months ago
<delamarche> but i kept quitting to work
<delamarche> :D
<delamarche> i'm more into the practical side of things now, esp. related to software engineering
AxleLonghorn has left #ocaml []
<benzo> hey I know this paper!
<benzo> it circulated on reddit.com
<delamarche> it's gotten a lot of buzz in the ocaml community recently
<delamarche> as far as we generate buzz
<benzo> since I'm a hones person I had a bad feeling reading it
<benzo> s/hones/honest
<delamarche> hahaha fair enough :)
<benzo> Copyright © Jason Hickey 2 Draft. Do not redistribute.
<delamarche> unfortunately it's the best intro I know to ocaml
<delamarche> i didn't redistribute it
<delamarche> you downloaded it off his website :D
<benzo> tonight I learnt more than in all my time reading in the ocaml book
hsuh has joined #ocaml
<delamarche> yeah that always happens when you just pick something and try to do it
<delamarche> my very first ocaml project was tetris
harlos has joined #ocaml
<delamarche> and boy did i learn a lot in a hurry
<delamarche> :D
<delamarche> the code is really, really ugly, but i'm just happy i got through it
<benzo> but when I look at hickeys paper I feel like I've walked 2 milimeters on 200 kilometer road
<pango_> delamarche: using Graphics, or... ?
<delamarche> opengl
<pango_> nice
<delamarche> not really
<delamarche> you should see it
<delamarche> it's fugly
<delamarche> actually i should just put it up
<pango_> ;)
<delamarche> i'm never gonna make it prettier
<delamarche> actually pango_ , i think it was you that helped me the most while i was doing it, if i remember correctly
<delamarche> lol
<benzo> ok thanks for your time - I'm gonna have some sleep
<benzo> bye and see you soon
<delamarche> ciao!
seafood_ has quit []
<pango_> it's quite possible I've forgotten about that ;)
<pango_> I think I'll go to bed too... 2am already :/
<benzo> that means we're living in the same time zone 8)
<delamarche> guh i can't get lablgl to build anymore
<delamarche> oh wells
benzo has left #ocaml []
pfoetchen has quit ["*blub*"]
thermoplyae has joined #ocaml
seafood_ has joined #ocaml
hasone has quit [SendQ exceeded]
pango_ has quit [Remote closed the connection]
pango_ has joined #ocaml
hasone_ has joined #ocaml
hasone_ is now known as hasone
delamarche has quit []
yminsky has joined #ocaml
ecc has quit [brown.freenode.net irc.freenode.net]
katz has quit [brown.freenode.net irc.freenode.net]
Madrok has quit [brown.freenode.net irc.freenode.net]
ertai has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
ecc has joined #ocaml
ertai has joined #ocaml
zmdkrbou has joined #ocaml
Madrok has joined #ocaml
middayc has left #ocaml []
mwc has joined #ocaml
AxleLonghorn has joined #ocaml
cygnus_ has quit [Read error: 110 (Connection timed out)]
cygnus_ has joined #ocaml
Illocution has quit ["Lost terminal"]
Illocution has joined #ocaml
jargonjustin_ has joined #ocaml
jargonjustin has quit [Read error: 104 (Connection reset by peer)]
ben___ has joined #ocaml
hsuh has quit ["rcirc on GNU Emacs 23.0.60.2"]
yminsky has quit [Read error: 110 (Connection timed out)]
thermoplyae has quit ["daddy's in space"]
goalieca has joined #ocaml
jargonjustin_ has quit []
jlouis has joined #ocaml
prince has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
johnnowak has joined #ocaml
ramkrsna has joined #ocaml
jlouis_ has joined #ocaml
rwmjones has quit [Connection timed out]
moss8282 has joined #ocaml
<moss8282> can someone give me a reference about an algebraic type then deconstructing it in SML NJ?
jlouis has quit [Read error: 110 (Connection timed out)]
prince has quit [Read error: 110 (Connection timed out)]
ben___ has quit [brown.freenode.net irc.freenode.net]
wy has quit [Read error: 110 (Connection timed out)]
ben___ has joined #ocaml
ben___ is now known as ziph
mwc has quit [Remote closed the connection]
seafood_ has quit []
seafood_ has joined #ocaml
prince has joined #ocaml
smimou has quit ["bli"]
zmdkrbou has quit [brown.freenode.net irc.freenode.net]
szell has quit [brown.freenode.net irc.freenode.net]
zmdkrbou has joined #ocaml
szell has joined #ocaml
rwmjones has joined #ocaml
goalieca has quit [Remote closed the connection]
goalieca has joined #ocaml
ramkrsna has quit [brown.freenode.net irc.freenode.net]
harlos has quit [brown.freenode.net irc.freenode.net]
ramkrsna has joined #ocaml
harlos has joined #ocaml
seafood_ has quit []
prince has quit [Connection timed out]
szell has quit [Connection timed out]
Linktim has joined #ocaml
ppsmimou has quit [Read error: 110 (Connection timed out)]
munga has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
ppsmimou has joined #ocaml
gim has joined #ocaml
munga has joined #ocaml
|Catch22| has quit []
det has joined #ocaml
Linktim has quit [Remote closed the connection]
Linktim has joined #ocaml
johnnowak_ has joined #ocaml
netx has quit [Remote closed the connection]
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
johnnowak has quit [Read error: 110 (Connection timed out)]
authentic has quit [Remote closed the connection]
authentic has joined #ocaml
Linktim has quit [Read error: 110 (Connection timed out)]
Snark_ has joined #ocaml
seafood has quit [Read error: 104 (Connection reset by peer)]
coucou747 has joined #ocaml
Snark_ is now known as Snark
ttamttam has joined #ocaml
johnnowak_ is now known as johnnowak
seafood has joined #ocaml
filp has joined #ocaml
ygrek has joined #ocaml
Yoric[DT] has quit ["Ex-Chat"]
moss8282 has left #ocaml []
benzo has joined #ocaml
petchema has joined #ocaml
johnnowak_ has joined #ocaml
gim has quit [Remote closed the connection]
ramkrsna has quit ["Leaving"]
johnnowak has quit [Read error: 110 (Connection timed out)]
Tetsuo has joined #ocaml
yminsky has joined #ocaml
johnnowak has joined #ocaml
ygrek has quit [Remote closed the connection]
johnnowak_ has quit [Read error: 110 (Connection timed out)]
goalieca has quit [Remote closed the connection]
<ziph> How do I test a list for membership of something? "List.exists ((=) 3) [1; 2; 3]" seems to be the most succinct way I can find.
<petchema> List.mem, List.memq
* ziph is blind, ta.
StoneNote has quit []
netx has joined #ocaml
yminsky has quit [Read error: 104 (Connection reset by peer)]
yminsky has joined #ocaml
johnnowak_ has joined #ocaml
gim has joined #ocaml
johnnowak has quit [Read error: 110 (Connection timed out)]
johnnowak_ has quit []
ziph has quit []
delamarche has joined #ocaml
delamarche has quit [Client Quit]
delamarche has joined #ocaml
mfp__ has joined #ocaml
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]
mfp_ has quit [Read error: 110 (Connection timed out)]
seafood_ has joined #ocaml
yminsky has quit [Read error: 104 (Connection reset by peer)]
yminsky has joined #ocaml
wy has joined #ocaml
benzo has quit []
middayc has joined #ocaml
hkBst has joined #ocaml
<letrec> Hi! One question. I defined a module type, and then a functor using it. I provide an implementation for this module type, and use it to 'instantiate' the functor. The issue is, in the resulting structure I cannot access functions defined in the module type, only the ones in the functor. Is it intended/how can I work around that?
szell has joined #ocaml
<flux> hmm.. module type doesn't have anything to access?
<letrec> To make things clearer: http://pastebin.com/m2ef36444
seafood_ has quit []
<flux> you can add include Num to the struct part of the functor
ttamttam has left #ocaml []
<delamarche> I would just like to say that the name 'letrec'
<delamarche> is totally awesome.
<flux> gotta share: day before yesterday I discovered there was a course Principles of Programming Languages going on, and its first deadline (nfa->dfa converter in Fortran) was due today 10am
<letrec> flux: thx, I'll try. delamarche: feel free to elaborate :)
<flux> finally yesterday night I spent 6 hours and today 2 hours in the morning, and returned the task (100% score) 15 minutes before deadline \o/
<delamarche> flux: You da MAN!
<flux> it was my fortune that I had written the same algorithm in ocaml some months ago
<flux> also, today, I learned that infact the assignment was not a mandatory, but is 5/60 of the course score (30 minimum).. had I known that I perhaps would've gone to sleep earlier than 2am.
mfp__ is now known as mfp
yminsky_ has joined #ocaml
yminsky has quit [Read error: 104 (Connection reset by peer)]
ttamttam has joined #ocaml
ben___ has joined #ocaml
middayc has quit []
jlouis has joined #ocaml
Yoric[DT] has joined #ocaml
<letrec> I'd like to implement a parser for a (very small) subset of C. Will Genlex do the job? (Or do I need to use something more complex as ocamlyacc)?
<petchema> Genlex can be used to parse OCaml-like languages, so I'd say no
ita has joined #ocaml
jlouis_ has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> Yeah, you'll need ocamlyacc (or, if you can, menhir).
<Yoric[DT]> Plus Genlex is only the lexer part, it doesn't solve any parsing problem.
ben___ has quit []
<flux> letrec, one nice parserthingamajic is the packrat family, one representative being aurochs; it can consume a lot of memory, though, and comes with close-to-nothing documentation ;)
<delamarche> any here played with ocamlp3l?
<delamarche> i really want to mess around with it
<Yoric[DT]> flux: yeah, but it's nice :)
<Yoric[DT]> delamarche: so do I.
<Yoric[DT]> I haven't found time to do it yet.
<delamarche> i was going to implement a library based on the berkeley dwarves from their landmark paper last year
<delamarche> and then i found ocamlp3l
<delamarche> and i was like SWEET!
<Yoric[DT]> Plus I'm jealous, because I've had the same idea as them but failed to find the time to implement it :)
<delamarche> sounds like we're in the same situation :D
<delamarche> can't beat'em, join'em
<jlouis> Menhir explains conflicts in terms of the grammar, not just in terms of the automaton. Menhir's explanations are believed to be understandable by mere humans.
<jlouis> Definitely a nice point.
<flux> yoric[dt], aurochs has an interesting approach too, the xml-of-parser-results generation part - it could be used even with non-ml programs
<Yoric[DT]> haven't seen that
<flux> hmm.. but you've tried it?-o isn't that how one tries it out?-o
bremac has joined #ocaml
<hcarty> delamarche: Is camlp3l maintained? Both it and JoCaml look like very cool projects.
<delamarche> i don't think it has seen much attention since it came out last year
<delamarche> but who knows, i think they're all grad students
<delamarche> they might just be working on it quietly
<delamarche> if they're not, i might actually try to extend it
<delamarche> we'll see
<delamarche> or at least keep it from rotting
<Yoric[DT]> flux: nope, just looked around it :)
ttamttam has left #ocaml []
<letrec> No lightweight alternative to using these tools? I just want to have a C subset with if/then/else and expressions (no function/variable definition)? I think it is LR(1) anyway though.
<mfp> I tried to give some visibility to JoCaml (http://eigenclass.org/hiki/wide-finder-conclusions ) but it's not easy
<flux> letrec, personally I would go with aurochs, because it allows to write the parser without a separate lexer
<mfp> ppl seem to equal distributed programming to haskell
<flux> letrec, one needs to read the whitepaper on pacrat parsers before using it, though, but after that is' quite simple
<mfp> oops I mean s/haskell/Erlang/ obviously
<flux> letrec, also last time I used it the error reporting was extremely minimal :)
<flux> letrec, if you don't mind getting everything, I think there are some C++ parsers for ocaml around..
<flux> elks?
<flux> or something
<mfp> then there's parallelism in Haskell, but it's an entirely different problem; not across machines, no fault resilience
AxleLonghorn has left #ocaml []
<letrec> flux: ok, thanks, I'll have a look. Looks like an interesting tool anyway.
<mfp> http://sourceforge.net/projects/cil "CIL (C Intermediate Language) compiles C programs into a simplified subset of C and assists with program analysis and transformation."
<delamarche> mfp: I'm not talking about distributed
<delamarche> I was thinking more single-machine, multiple cores
<delamarche> I think that's a much more interesting problem
<delamarche> sure, if you have gobs of data, parallelizing buys you a lot
<delamarche> it's much harder if you're trying to squeak as much as you can out of $n$ cores in any given program
<delamarche> i was talking to the vp of engineering at electronic arts about ocamlp3l
<delamarche> and other stuff
<delamarche> and he said he had one of his engineers write a program that basically just tried to hog as much of the total cpu usage as it could on the ps3
<delamarche> when they got above an average of 35% utilization on each core in their test consoles that sony gave them
<delamarche> they _melted the casings_ around the chips
<flux> hm, why wouldn't they get 100%?
<flux> thermal throttling?-o
<delamarche> because you have to copy the data into a shared memory before the vector cores can process it
<delamarche> and that copying is orders of magnitude slower than the cores can run
<delamarche> so it's a bottleneck
<flux> oh, I wasn't thinking the work needed to be useful :)
<delamarche> it wasn't useful
<delamarche> the program was just a dummy thing to generate computation, basically :)
<delamarche> anyhow that's my boring rant
<jlouis> So if that is a bottleneck, you can't stream data to the thing. But you can probably still retrieve and block and keep bashing the very same block of data. Of course that only works for some data problems
Jedai has quit ["KVIrc 3.2.4 Anomalies http://www.kvirc.net/"]
<delamarche> and even then, only if the solution has been architected properly
<delamarche> i mean, the problem with them is that they have a teeny bit of data they need to compute between every frame, say
<delamarche> or at least that's how they think about it
bremac has left #ocaml []
<delamarche> so their engineers stepwise-refine the problems until at the lowest level, there are a bunch of tiny functions each operating on maybe one piece of data
<delamarche> it's hard from a higher level in the architecture to get all of that and aggregate it so that you can split it up and parallelize it, fast enough so that you actually see savings
<delamarche> *shrug*
<delamarche> super cool stuff
Yoric[DT] has quit ["Ex-Chat"]
^authentic has joined #ocaml
jlouis_ has joined #ocaml
<hcarty> I am looking forward to being able to afford to spend the money on a PS3 and play around with programming on it
<hcarty> Particularly since OCaml apparently has some level of function on the system
gunark has quit ["Konversation terminated!"]
<hcarty> Does camlp3l work with OCaml 3.10.x?
middayc has joined #ocaml
<delamarche> I doubt it
<delamarche> i find that anything i used to have that built on 3.09 isn't happy with 3.10, which sort of surprised me
<delamarche> i can't even build labgl anymore
<delamarche> although i may have screwed something up
jlouis has quit [Read error: 110 (Connection timed out)]
<hcarty> I have had good results going from 3.09 to 3.10 with non-camlp4'd things. But I am sure that is largely due to the libraries I use
authentic has quit [Read error: 110 (Connection timed out)]
^authentic is now known as authentic
<hcarty> That, and relying on godi or Debian to sort out the upgrading details
<letrec> I miss the file ../lib/ocaml/ocamlbuild/ocamlbuild.cmx with 3.10. Any idea?
|Catch22| has joined #ocaml
<hcarty> letrec: Did you run "make opt" after "make world", or just "make world.opt"? I think the native code compiler is built in a separate step
ben has joined #ocaml
<hcarty> Or this may not be an OCaml compiling question...
<delamarche> isn't ocamlbuild seperate from the main distro?
<letrec> During the gmake install phase, there is a 'don't install ocamlbuild.cmx' message. Strange
<hcarty> It is part of the official OCaml package in 3.10.0+
<letrec> I did make opt.
<delamarche> Oh wow, didn't know that.
pango_- has joined #ocaml
ben has quit []
benzo has joined #ocaml
marmottine has joined #ocaml
Morphous_ has joined #ocaml
dwmw2_gone is now known as dwmw2_AVF
Morphous has quit [Read error: 110 (Connection timed out)]
benzo has quit [Read error: 104 (Connection reset by peer)]
benzo has joined #ocaml
dwmw2_AVF is now known as dwmw2_gone
Waleee has joined #ocaml
thermoplyae has joined #ocaml
middayc____ has joined #ocaml
filp has quit ["Bye"]
evn has quit []
bluestorm has joined #ocaml
harlos has quit [Read error: 104 (Connection reset by peer)]
<hcarty> delamarche: For what it's worth, I just downloaded and compiled ocamlp3l. I haven't tested it, but it did "make configure && make compile" cleanly using Debian's OCaml 3.10.1 packages
<delamarche> wickedawesome
<delamarche> i have the additional fun of being on os/x
<delamarche> i was on debian for like 6 years i think
<delamarche> :)
<delamarche> gonna build me another box one day soon
<hcarty> There may not be much trouble in OSX - it seems to be written entirely in OCaml
<hcarty> But "may not be" and "is no" are two completely different things in this context...
<hcarty> "may not be much" and "is no" that is
thermoplyae has quit ["daddy's in space"]
<flux> delamarche, I think I've read that lablgl had issues due to bugs fixed in the compiler, and it just happened to exploit those bugs. but they were fixed in lablhl, an upgrade should help? or perhaps you are referring to other kinds of problems
<delamarche> to be honest, i didn't try very hard
<delamarche> i don't even know what version i tried to build
<delamarche> i was half-blind and brain dead last night when i tried
bongy has joined #ocaml
<delamarche> i'm gonna read the ocamlp3l manual now as i eat lunch though
harlos has joined #ocaml
<jonafan> printf sure is clever
Sapan has left #ocaml []
marmottine has quit [Remote closed the connection]
<jonafan> frankly, i don't understand it in the least
jlouis has joined #ocaml
<jonafan> printf "asdf" returns (), printf "%s" returns string -> (), printf "%s%s" returns string -> string -> ()
<jonafan> ...... how?
<hcarty> jonafan: The printf family of functions have special handling in OCaml
<delamarche> you know what i've discovered
<delamarche> in my exploration of ocaml
<delamarche> french people who try to make abbreviations for english words do very strange things
<delamarche> lol
<jonafan> hehe
* delamarche continues reading the ocamlp3l manual
<jonafan> the french and english have very different ideas about writing
<hcarty> They are included to have a C-like printf in a language that normally would not support such a thing
<jonafan> so it's sort of craziness built into the language?
<jonafan> the rules are bent because printf is just that useful?
<hcarty> That is my understanding
<hcarty> printf is just that darn cool
<jonafan> oh well, it's pretty cool because it's actually type safe
<mbishop> I never found printf THAT useful, but it's sometimes good to have, and Ocaml is about options so *shrug*
<hcarty> I use it quite often... along with sprintf. It can save a lot of typing.
<jonafan> in c, passing an int instead of a string would probably result in somethign weird happening
<hcarty> And it does not hurt readability that much IF used carefully
harlos has quit [Connection reset by peer]
<bluestorm> hcarty: you can come up with purely functional printf
<jonafan> instead of the right thing, which is for it to stop you
<bluestorm> except that with not syntaxic sugar, it's ugly
<hcarty> bluestorm: Exactly
<jonafan> seems like you could do it with CPS
<bluestorm> i've a decent paper about that if you're interested
<hcarty> The folks who want to keep everything in their program purely functional, though, tend to not use printf from what I've seen here and on th ML
<jonafan> you know what, i think i am
jlouis_ has quit [Read error: 110 (Connection timed out)]
<bluestorm> there is a mix of "pure CPS" and "primitively-defined CPS", the latter being quite strange if you're not used to eg. Scheme call/cc
<jonafan> can't read PS here so i'll have to read it at home
<bluestorm> (ps2pdf14 rules)
<hcarty> delamarche: If you do give ocamlp3l a try, please post your results. I am trying some of the examples in the manual and not getting the indicated results. Type differences, mainly
<delamarche> will do :D
<delamarche> i like the model so far
<jonafan> ah hah, i had it on cygwin
<hcarty> Ah, I see the problem - some of the examples are missing some type casts/converting function calls
jonathanv has joined #ocaml
jonafan has quit [Nick collision from services.]
jonathanv is now known as jonafan
srid has joined #ocaml
ygrek has joined #ocaml
<delamarche> whoa
<delamarche> they have a ||| operator
<delamarche> i think that's the first 3-character operator i've ever seen
<delamarche> hahaha
<thelema> delamarche: perl6 has ==> operator
<delamarche> i'm glad i abandoned perl when i did
<thelema> I still like perl, although I like ocaml more.
srid has quit [Read error: 104 (Connection reset by peer)]
<thelema> and perl5 has the spaceship operator...
<thelema> it seems perl6 even has ==>> as an operator.
<hcarty> I don't know if it still does, but Perl6 also had "hyperoperators"
<hcarty> Something like <<+>>
<thelema> hcarty: yes, I think it still has them.
bongy has quit ["Leaving"]
<thelema> perl6 even has !=== as an operator (negated value identity)
<hcarty> If Perl 6 came along sooner, or if Perl 5 had easier function argument type restrictions, I likely would have stuck with Perl + PDL rather than coming to OCaml
<thelema> perl6's ^fff^ operator... heh
<flux> how are its static typing capabilities coming along? it was suppose to have them, too, wasn't it?
<thelema> it's supposed to have everything. I imagine things are coming slowly. I've noticed lots of good ideas from perl6 backported to perl5
* thelema worries about the junctive operators in perl6
Yoric[DT] has joined #ocaml
<mbishop> they need a pffft operator
<hcarty> Does the "any function as infix" camlp4 extension exist for OCaml 3.10?
<Yoric[DT]> 'evening
<hcarty> If so, we could beat them to it
<jonafan> soooooo shift/reset?
<flux> hcarty, I think I've seen that..
<flux> I suppose it would be like in SML. you wouldn't be able to open/include such operators to a scope.
<delamarche> i developed several huge perl applications
<delamarche> which caused me to switch to python and not look back :D
<delamarche> i just threw together a demo for some thing i'm trying to launch, actually
<delamarche> that's the demo site, if anyone is interested
<delamarche> it's nothing big :)
<Yoric[DT]> Does anyone know Henri Binsztok ?
middayc_ has joined #ocaml
<hcarty> flux: I know it exists for camlp4 3.09 (and maybe works with camlp5?). And I think you are correct - each module/file would have to be preprocessed and declare the infix locally
middayc_ has quit [Client Quit]
middayc_ has joined #ocaml
<bluestorm> hcarty: have you seen the "ocaml only" trick for "any function as infix" ?
<bluestorm> (no camlp4 needed)
<bluestorm> (it's slightly heavy, though)
<bluestorm> in Yoric[DT]'s version, you use /*foo*/ as the Haskell `foo`
<bluestorm> (you could use /% %/ if you're confused by this C-ish /* ... */ )
middayc has quit [Read error: 110 (Connection timed out)]
middayc____ has quit [Read error: 110 (Connection timed out)]
<hcarty> bluestorm: I have not, but that makes sense
<bluestorm> let (>@) x f = f x and (@<) f x = f x;;
<bluestorm> let modulo a b = a mod b;;
<hcarty> I was just testing that in the toplevel :-)
<bluestorm> 9 >@ modulo @< 1
<bluestorm> hm
<hcarty> Thanks... I don't know if I will use it, but it is useful to know
<hcarty> let (/%) x f = f x and (%/) f x = f x;;
<bluestorm> the %/ thing was used to get *high* priorities
<bluestorm> but i don't really remember why, and now that i think of it, it seems low prorities are actually better
<bluestorm> (but i'm tired so..)
<bluestorm> eg. with >@ instead of /* you can use a + b >@ modulo @< c * d
<bluestorm> hmm
<bluestorm> as (a + b) ... (c * d)
<bluestorm> depends on what you want actually :p
<thelema> l
<jonafan> man, cps is so confusing
<thelema> the best would allow assigning a priority, but that we can't do that in ocaml.
* thelema has been reading about the crazy developments in perl6
<hcarty> You can assign priority with camlp4 though I think
<jonafan> i think i got it
<jonafan> very cool
AxleLonghorn has joined #ocaml
thelema has quit [Read error: 104 (Connection reset by peer)]
Snark has quit ["Ex-Chat"]
xd has quit [Connection timed out]
<flux> haskell's `foo` has the problem (well, could be viewed as an advantage?) that you cannot give it parameters
rogo has quit [Read error: 110 (Connection timed out)]
<flux> so no `some_curriable_fun 42` for you
<flux> I suppose that >@ @< -trick atleast gives that
<flux> but if you have a complicated expression with other operators too, it might break down?
<hcarty> Unless you use appropriate ((())), but that makes it even more verbose
jargonjustin has joined #ocaml
hasone has quit [Read error: 110 (Connection timed out)]
middayc_ has left #ocaml []
hasone_ has joined #ocaml
hasone_ is now known as hasone
Linktim has joined #ocaml
fbvortex has joined #ocaml
<fbvortex> Is it a rule that when doing guarded matches (i.e. with a "when" clause), you can't chain the guarded match patterns with successive or preceding patterns?
<Smerdyakov> No.
Mr_Awesome has quit ["aunt jemima is the devil!"]
delamarche has quit []
<mbishop> Smerdyakov: are you adamc on reddit?
<Smerdyakov> mbishop, I forget.
<Smerdyakov> mbishop, I certainly haven't posted anything to it in months, if I ever created an account.
<mbishop> ah
<mbishop> well then I doubt it is, since someone with the name adamc just posted "The Mystery of b := (b = false)"
<Smerdyakov> Weird. I was just reading that paper.
<Smerdyakov> (And not via Reddit)
Morphous_ has quit ["shutdown"]
Amorphous has joined #ocaml
mperillo has joined #ocaml
mperillo has left #ocaml []
Yoric[DT] has quit ["Ex-Chat"]
middayc has joined #ocaml
middayc has left #ocaml []
thelema has joined #ocaml
Waleee has quit []
bluestorm has quit ["Konversation terminated!"]
hasone_ has joined #ocaml
hasone has quit [Read error: 110 (Connection timed out)]
middayc____ has joined #ocaml
StoneNote has joined #ocaml
AxleLonghorn has left #ocaml []
middayc____ has left #ocaml []
thermoplyae has joined #ocaml
AxleLonghorn has joined #ocaml
umod has joined #ocaml
ygrek has quit [Remote closed the connection]