rwmjones changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.1 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
postalchris has quit [Read error: 110 (Connection timed out)]
ReachingFarr has quit ["going home"]
postalchris has joined #ocaml
seafood_ has joined #ocaml
dramsay has joined #ocaml
seafood_ has quit [Client Quit]
dramsay has quit [Client Quit]
thermoplyae has joined #ocaml
_Azimuth has joined #ocaml
_Azimuth has quit ["leaving"]
postalchris has quit ["Leaving."]
AxleLonghorn has joined #ocaml
yangsx has joined #ocaml
seafood_ has joined #ocaml
<mbishop> I'm trying to figure out how to write a functional Knuth shuffle...
<mbishop> http://paste.lisp.org/display/55029 is my imperative code
<mbishop> but I can't figure out a functional version :\
<AxleLonghorn> well, I guess that depends on how you want it to be functional?
<AxleLonghorn> do you want to remove the for loop?
<AxleLonghorn> whoops... a little late I see
Torment has quit [Read error: 104 (Connection reset by peer)]
<mbishop> AxleLonghorn: late how?
<mbishop> a functional version would use recursion rather than the for loop, and be non destructive
hsuh has joined #ocaml
hsuh has quit [Remote closed the connection]
<AxleLonghorn> yeah
<AxleLonghorn> I meant a little late in responding
<AxleLonghorn> I am interested in seeing a non destructive version though
<AxleLonghorn> the recursion part is easy (imo), but I don't know how you'd do the non-destructive part. Clone the array?
mbishop has quit ["bbiab"]
albacker has joined #ocaml
dobblego has quit ["Leaving"]
albacker has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has left #ocaml []
jderque has joined #ocaml
Jedai has joined #ocaml
<flux-_> hm, I don't think you're supposed to call Random.self_init () that often (more like: once in the whole program!), but mbishop is gone
ttamttam has joined #ocaml
thermoplyae has quit ["daddy's in space"]
<pango> it's not unusual that a specific algorithm is better implemented in a specific paradigm (or even, that it impersonate a paradigm); So a better question is probably "how do you shuffle a set/list/... of elements in a functional way?"
Tetsuo has joined #ocaml
mrsolo_ has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
Tetsuo has quit [Read error: 104 (Connection reset by peer)]
Tetsuo has joined #ocaml
filp has joined #ocaml
middayc has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
gabriel has joined #ocaml
rwmjones has quit [Remote closed the connection]
rwmjones has joined #ocaml
ygrek has joined #ocaml
rwmjones has quit ["Closed connection"]
rwmjones has joined #ocaml
ppsmimou has quit ["Leaving"]
ppsmimou has joined #ocaml
Snrrrub has quit [Read error: 110 (Connection timed out)]
yangsx has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
mfp has joined #ocaml
hkBst has joined #ocaml
Yoric[DT] has quit [Read error: 110 (Connection timed out)]
rwmjones has quit ["Closed connection"]
<flux-_> pango, with the same propability of making a good shuffle, I suppose
<flux-_> so given the same random function, produce the same shuffle?
rwmjones has joined #ocaml
middayc has joined #ocaml
asmanur has joined #ocaml
alexp has joined #ocaml
StoneNote has quit []
middayc has quit []
RobertFischer has joined #ocaml
asmanur has quit [Remote closed the connection]
asmanur has joined #ocaml
Mr_Awesome has quit [Read error: 110 (Connection timed out)]
Mr_Awesome has joined #ocaml
gabriel has quit ["leaving"]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
seafood_ has quit []
munga has joined #ocaml
albacker has joined #ocaml
Snrrrub has joined #ocaml
seafood_ has joined #ocaml
albacker has quit [Nick collision from services.]
flux-_ is now known as flux
pango has quit [Remote closed the connection]
pango has joined #ocaml
jonathanv has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
jonathanv is now known as jonafan
jonathanv has joined #ocaml
jonafan has quit [Nick collision from services.]
jonathanv is now known as jonafan
<flux> uhm.. with CamlGI, how is one supposed to get a Cgi.Request.t, which apparently is required for all action?
jonathanv has joined #ocaml
Morphous_ has joined #ocaml
jderque has joined #ocaml
jonafan has quit [Nick collision from services.]
jonathanv is now known as jonafan
munga has quit ["Leaving"]
ttamttam has left #ocaml []
Morphous has quit [Connection timed out]
jonathanv has joined #ocaml
jonafan has quit [No route to host]
dramsay has joined #ocaml
seafood_ has quit []
marmottine has joined #ocaml
alexp has quit ["Leaving"]
filp has quit ["Bye"]
<bla> flux, thread-ring is marked with 'error' on shootout currently.
<bla> No idea why. ;d
<bla> Oh that is on the second server.
postalchris has joined #ocaml
bluestorm has joined #ocaml
hcarty has quit [Read error: 110 (Connection timed out)]
jlouis has joined #ocaml
huh__ is now known as huh
hcarty has joined #ocaml
Yoric[DT] has joined #ocaml
postalchris has quit [Connection timed out]
jlouis_ has quit [Read error: 110 (Connection timed out)]
ttamttam has joined #ocaml
ttamtta1 has joined #ocaml
<flux> hmh, there's something integral to god build system that requires that /usr/lib/dc is a binary (which it isn't!)
<flux> godI :-)
<flux> and I can't find it..
ttamttam has left #ocaml []
ttamtta1 has left #ocaml []
ttamttam has joined #ocaml
<flux> maybe find_prog_for_defs_mk is the culprit
<flux> however /usr/lib isn't even in the path
<flux> ah-ha, std_path contains /usr/lib for SunOS
<flux> and even before /usr/bin!
Yoric[DT] has quit ["Ex-Chat"]
Yoric[DT] has joined #ocaml
asmanur has quit [Remote closed the connection]
jonathanv is now known as jonafan
ita has joined #ocaml
postalchris has joined #ocaml
jonathanv has joined #ocaml
thermoplyae has joined #ocaml
jonafan has quit [Read error: 110 (Connection timed out)]
postalchris has quit [Read error: 110 (Connection timed out)]
jonathanv is now known as jonafan
jlouis_ has joined #ocaml
jlouis has quit [Read error: 110 (Connection timed out)]
<bluestorm> rwmjones: when using cocanwiki for the "OSR" stuff, i've been annoyed by a few things (most importantly, the difficulty of user-to-user discussion inside the wiki)
<bluestorm> i was considering trying to add some features myself
<bluestorm> so i'd like to know if you're open to external contributions, and ready to "upgrade" wiki.cocan.org if some of them got accepted
<bluestorm> and i'm not sure of what your opinion concerning the "wiki syntax" : do really you want to get rid of it ? why ?
middayc has joined #ocaml
jderque has quit [Read error: 113 (No route to host)]
ttamttam has left #ocaml []
thermoplyae has quit ["daddy's in space"]
ygrek has quit [Remote closed the connection]
jonathanv has joined #ocaml
asdfasdf has joined #ocaml
jonafan has quit [Nick collision from services.]
asdfasdf is now known as jonafan
thermoplyae has joined #ocaml
jonathanv has quit [Read error: 110 (Connection timed out)]
postalchris has joined #ocaml
middayc has quit [Read error: 104 (Connection reset by peer)]
middayc has joined #ocaml
<bluestorm> hm
<bluestorm> the new Ocaml Summer Project is out
<bluestorm> too bad we need "joint application from a faculty menter", ruling out some peoples (including, tragically, me)
<bluestorm> but let's see what we've got this year
<bluestorm> i hope projects will get more after-the-summer maintainance
gabriel__ has joined #ocaml
mbishop has joined #ocaml
gabriel__ has quit ["leaving"]
CRathman has joined #ocaml
pango has quit [Remote closed the connection]
pango has joined #ocaml
StoneNote has joined #ocaml
kbidd has joined #ocaml
<kbidd> I'm new to caml... can anyone tell me what's wrong with this class declaration? http://www.nopaste.com/p/aMruh2jaN (I assume its a syntax error, but I modeled it off of an example at http://www.ocaml-tutorial.org/objects)
<bluestorm> ( [] : Task list)
<bluestorm> task ?
<bluestorm> case is significant
<kbidd> ah
<kbidd> that would be it :P
<kbidd> thanks!
<bluestorm> ah
<bluestorm> "val ref deps"
<bluestorm> ref doesn't exists here
<bluestorm> it's on the right
<bluestorm> val deps = ref ...
<bluestorm> ref is only a function
<bluestorm> not a special keyword
<bluestorm> in the toplevel :
<kbidd> i hate new languages :P
<bluestorm> # ref;;
<bluestorm> - : 'a -> 'a ref = <fun>
<bluestorm> (the "ref" in the type refers ( :p ) to the "ref" type, not the "ref" function)
<kbidd> makes sense
<kbidd> awesome... that worked
<bluestorm> if you're new to OCaml
<bluestorm> i suggest you try non-POO style first
<bluestorm> POO in OCaml is rich but very different to what you usually know, and can raise some very subtle typing issues
<bluestorm> i think a good overview of the non-POO language is helpful
<bluestorm> hm
<bluestorm> i mean, Object Oriented Programming
<bluestorm> ( :-' )
<kbidd> lol... yeah, i guessed
<bluestorm> anyway, most ocamlers only rarely use OOP
<bluestorm> the "common" style is the functional one
<bluestorm> even if of course you can see objects here and here
<Yoric[DT]> well, mostly there, not much here :)
* Yoric[DT] has enough difficulties explaining convincingly what records are all about without getting to OOP :)
<bluestorm> hm
<bluestorm> imho record is quite easy
<Yoric[DT]> Well, records are ok.
<bluestorm> "see, tuples can lead to a big mess when you've more than 3 things inside, so we need names"
<kbidd> yeah, i havn't really ever done a whole lot of functional programming
<Yoric[DT]> But explaining the philosophical difference between records, tuples and sum types with only one constructor and possibly several arguments ... that's already somewhat harder.
<bluestorm> plus you can use my last hype and pink camlp4 extension to get automatic field-accessing-function declaration ( http://bluestorm.info/camlp4/pa_ty_constr.ml.html )
<Yoric[DT]> Yep, saw that :)
<bluestorm> hm
<bluestorm> i'm not sure there is any "philosophical difference" actually
<bluestorm> it even seems that
<bluestorm> SML use a mixed ADT/record style
rwmjones has quit ["Closed connection"]
<Yoric[DT]> That's the problem, three different concepts, all of which can fill the same niche (four concepts if you include OOP).
<Yoric[DT]> Explaining each is easy (except OOP).
<Yoric[DT]> I'm afraid explaining them all will lead to confusion.
<bluestorm> hm, i can't find that SML example again
<bluestorm> might have been wrong
<Yoric[DT]> I've seen that.
<bluestorm> but i've seen something like type 'a tree = Leaf of 'a | Tree of { left : 'a tree; node : 'a; right : 'a tree }
<Yoric[DT]> (source code of JS2, for instance)
<Yoric[DT]> I've been considering writing a Camlp4 extension to provide that kind of thing.
<Yoric[DT]> Not enough time.
<Yoric[DT]> Any interesting example of a polymorphic record ?
<bluestorm> hm ?
<bluestorm> hmm
<bluestorm> during a lesson i've used record for finite-state automata
<bluestorm> FSA abstracted over the input/alphabet type are polymorphic
<Yoric[DT]> That's too high-level for this stage of my lecture/tutorial.
<bluestorm> (of course the actual lesson code used "char" everywhere :-')
<Yoric[DT]> :)
<Yoric[DT]> Well, maybe I'll keep polymorphic types for after I've introduced sum types.
<bluestorm> you introduce records before sum types ?
<bluestorm> strange
<bluestorm> i think sum types (+ product types, but tuples are usually more simple than records to show) really are the core of the ML languages
<Yoric[DT]> Well, I like to start a bit slowly.
<bluestorm> sometime i even think of creating a tutorial axed on the symmetry between expression and patterns
<bluestorm> (the problem is that this symmetry doesn't go very far)
<Yoric[DT]> It might be interesting to introduce sum types before record types, but then I'd have to introduce pattern-matching first.
<Yoric[DT]> Well, that is, pattern-matching before sum types.
<Yoric[DT]> Actually, that's not necessarily a bad idea.
<bluestorm> you can introduce pattern matching on lists
<bluestorm> then sum types
<bluestorm> and then "hey, lists are sum types actually !"
<Yoric[DT]> I was planning on introducing lists after pattern-matching.
* Yoric[DT] rethinks his plans.
<bluestorm> (one advantage of this approach is that lists come with a good set of examples and tests : list.mli)
<bluestorm> hm
<bluestorm> on the other hand, list are maybe not so easy to grasp, as they require an recursion-friendly mindset
<Yoric[DT]> Well, I've introduced recursion already.
<bluestorm> you could think non-recursive sum types (C-like enums for example) are easier things to start pattern matching with
<bluestorm> hm
<bluestorm> plus the list-related revised syntax is soo ugly :-'
<Yoric[DT]> :)
<Yoric[DT]> So I need to introduce products, sums, lists and pattern-matching.
<Yoric[DT]> products have simple pattern-matching
<Yoric[DT]> lists are special sums, but they're necessary so often that they deserve a special role
<Yoric[DT]> Indecision, indecision...
<bluestorm> Yoric[DT]: do you refer your students directly to the wiki page ?
<Yoric[DT]> Nope.
<Yoric[DT]> But it serves as a blueprint.
<bluestorm> hm
<bluestorm> is your other version very different ? do you sync them ?
<Yoric[DT]> Yeah, I sync them.
marmottine has quit ["Quitte"]
psnively has joined #ocaml
bluestorm has quit ["Konversation terminated!"]
<Yoric[DT]> I've just finished teaching the chapter on functions.
<Yoric[DT]> Well, on values.
dramsay has quit [Read error: 110 (Connection timed out)]
RobertFischer has left #ocaml []
middayc has quit [Read error: 104 (Connection reset by peer)]
middayc has joined #ocaml
CRathman has quit ["ChatZilla 0.9.80 [Firefox 2.0.0.11/2007112718]"]
Tetsuo has quit ["Leaving"]
NF9 has joined #ocaml
postalchris has quit ["Leaving."]
yangsx has joined #ocaml
NF9 has left #ocaml []