mbishop changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Grab Ocaml 3.10.0 from http://caml.inria.fr/ocaml/release.html (featuring new camlp4 and more!)
wy has joined #ocaml
brooksbp has joined #ocaml
brooksbp has quit [Client Quit]
pattern has quit [Remote closed the connection]
wy has quit ["Ex-Chat"]
qpu has quit [Read error: 110 (Connection timed out)]
pattern has joined #ocaml
sadmac has quit [Read error: 110 (Connection timed out)]
<context> is there a way to "magically" turn something into a string, i dont care what it is currently
<context> or at least, getting the type of something, to be able to call the correct method
<Jeff_123> hm
<Jeff_123> do you want like a function that takes anything and returns its type as a string?
<Jeff_123> there's Marshal.to_string for turning things into strings, but it's not human readable
<Smerdyakov> context, your question is ill-formed. Are you asking if you can do this from an OCaml program, using purely OCaml code/
qpu has joined #ocaml
<context> i guess im trying to 'script' a little to much.
<Jeff_123> Probably :)
<context> i guess with objects i could easily require a to_string method
<context> though is there a way to get the type of a vriable
<Jeff_123> eeeew objects
<context> so i could just match against it
<Smerdyakov> context, try to use functors instead.
<context> jeff_123: i get objects but im not big friends with them :/
<Jeff_123> ewwwwww functors
<Smerdyakov> context, no, there is no way to get the type of a variable. (Again, your question is vague, but I'm answering assuming the most likely interpretation.)
<context> i program functionally "objectively" but when it comes to actually making objects :/
<Jeff_123> I get functiors but the only reason I've found to use them is because exceptions aren't polymorphic.
<Smerdyakov> Jeff_123, then you're a bum.
<context> i put to much in one place or in in the wrong place blah blah blah
<Jeff_123> way to insult me, person who talks like a robot
<Smerdyakov> Functors are the best tool out there for assembling complex components into larger complex components.
<context> smerdyakov: well im actually gonna write something jeff told me to, that is a simple templating language that replaces %{blah} with the value, but id like to simply be able to turn anything into a string
<context> vs having the template tell you
<Jeff_123> You can use ocaml's type system to get type information if you dont mind a restricted type system.
<Jeff_123> type example = Int of int | String of string;;
<xavierbot> type example = Int of int | String of string
<context> ahh
<Jeff_123> let get_type = function Int _ -> "int" | String _ -> "string"
<Jeff_123> ;;
<Jeff_123> let get_type = function Int _ -> "int" | String _ -> "string";;
<xavierbot> val get_type : example -> string = <fun>
<Jeff_123> get_type (String "a string");;
<xavierbot> - : string = "string"
<context> err
<Jeff_123> get_type (Int 123);;
<xavierbot> - : string = "int"
<Jeff_123> let get_type2 = function Int _ -> `Int | String _ -> `String;;
<xavierbot> val get_type2 : example -> [> `Int | `String ] = <fun>
<Jeff_123> get_type2 (Int 123);;
<xavierbot> - : [> `Int | `String ] = `Int
<Jeff_123> Ignore that if you dont yet understand variant types.
<Smerdyakov> Whenever someone asks questions like context's, it's usually misguided to take the question literally. More commonly, the question is a sign of bad architectural decisions.
<Jeff_123> saying "Your question is illformed" is a VERY strange way to point that out.
jsk has quit [Read error: 110 (Connection timed out)]
<Jeff_123> To me it sounds insulting, like you're telling me I can't hardly speak English or something.
<Smerdyakov> Not so strange among PL folk.
<Smerdyakov> I'm not going to use long-winded descriptions because a minority of people here find the to-the-point alternatives insulting.
hkBst has quit ["Konversation terminated!"]
<context> heh
<context> its ok . ;)
<Jeff_123> "I'm not sure what you're trying to ask." is pretty to the point...
<Jeff_123> :P
<Smerdyakov> My version stresses that the question isn't portable across minds.
<Jeff_123> your version says it's not a question in the first place
<Smerdyakov> Yeah, if it were a program, it would fail to type-check.
<context> mm so function really is different than fun :x
<Jeff_123> I just mean to say it sounds pretty impolite. I didn't like it when you told me that once. From now on I can pretend you're a robot and laugh instead of feel bad.
<Smerdyakov> Or you can pretend that I'm a logician, and you don't even really have to pretend.
<Jeff_123> "function" takes 1 argument and allows immediate pattern matching, fun allows multiple and no pattern matching
<context> jeff_123: yeah i just seen it deny my pattern match ;)
<Jeff_123> Hey, I've had my share of logic training.
<Smerdyakov> Did you spend 5 years doing it every day?
<context> you guys really dont have to argue on my account. its friday, i hope your not bored :X
<context> ;)
<Smerdyakov> context, ah, an IRC neophyte. No one in these realms needs a reason to argue. :P
<context> haha, true
<Jeff_123> no i didnt do THAT much logic
kmeyer has quit [Read error: 113 (No route to host)]
konrad__ has joined #ocaml
<Smerdyakov> Jeff_123, well, then you're not a logician! You can decide whether to be relieved or saddened. :-)
<Jeff_123> but I dont see why being a logician means you have to be impolite either
<Jeff_123> No I think logic is cool. on my to-read list is a book on temporal logic.
<Smerdyakov> Precision is only impolite to non-logicians.
<Smerdyakov> Life is better when you communicate in forms that are portable to different minds.
<Jeff_123> There's more to speech than just literal meaning you know. there's social context
<Jeff_123> (I have semantics and pragmatics training too :P )
<Smerdyakov> Sure, and social context leads to lots of problems.
<Jeff_123> ignoring it can lead to lots of problems too
<Smerdyakov> It's better to avoid it whenever you can.
<Jeff_123> spoken like a true introvert :)
<Smerdyakov> It leads to problems with people who don't buy into precise language.
<Smerdyakov> I enjoy life more when I say what I mean. It's worth pissing lots of people off.
<Jeff_123> Oh I thought the point was so that your speech was portable across minds?
<Jeff_123> whatever that means :P
<Jeff_123> If I wanna get really picky I'd even say that's not possible since noone's demonstrated there's anythign called "minds", seeing as noone's defined it.
<Jeff_123> so such portability is an exercise in futility perhaps?
<Smerdyakov> Yeah, I don't think that objection has any objective merit.
<Smerdyakov> The lack of scientists to come up with mathematical theories doesn't seem to stop us from communicating effectively.
<Jeff_123> Hey, I'm just being a good philosopher and logician here. I mean, you claimed that you know how to make thoughts portable across minds or something right?
<Jeff_123> But I ask you, what is a mind?
<Jeff_123> Does anyone know?
<context> talking bout me again :p
<Jeff_123> haha right
<Jeff_123> no I'm just pickign on smerdyakov
<Jeff_123> I've studied enough Philosophy of mind and language to be able to be an ass about it, just like smerdy likes to be an ass about logic I guess :)
<Smerdyakov> I just deny the interest of your question, Jeff_123.
<Smerdyakov> The answer to it doesn't seem to have any effect on my life.
<Jeff_123> heh, suit yourself
buluca has quit [Read error: 110 (Connection timed out)]
Jeff_124 has joined #ocaml
<Jeff_124> bleh, my old tank of a powerbook crashed
<Jeff_124> but anyway suit yourself, though IMO if we REALLY knew a lot about our "minds" just the medical advances it'd allow would be tremendous. I'm just speculating, but usually a leap in knowledge tha tgreat is associated with a great leap in engineering.
<Jeff_124> but I was GOING to say, before the lockup
<Smerdyakov> True enough. I just think many other questions should take precedence today.
<Jeff_124> What sort of work did you do as a logician?
buluca has joined #ocaml
<Jeff_124> Perhaps you proved the Buluca Postulate? I heard that was a tough one.
<Smerdyakov> I do certified programming.
<Smerdyakov> Though I'm not doing any ATM.
Jeff_123 has quit [Read error: 104 (Connection reset by peer)]
Jeff_124 has left #ocaml []
Jeff_123 has joined #ocaml
<Jeff_123> damn. I was hoping you did pure logic.
magnus_ has joined #ocaml
<Smerdyakov> I do something much purer than what mathematicians do, because it's easy to cut corners when you don't need to convince a computer./
<buluca> did someone proved my existence?
<Jeff_123> Yup I think Smerdy did.
<Jeff_123> How's Jane's street? Are they still struggling to make GUIs they like? That's probably the only thing I've read about that they didnt like about ocaml.
<buluca> cool, so now I may tell this around
<Smerdyakov> Jeff_123, it's "Jane Street," not "Jane's street."
<Jeff_123> fair enough
<buluca> sorry, I can't do anything ocaml-related at the moment
<Smerdyakov> Jane Street is swell.
<Jeff_123> that's good
<konrad__> ouch, I spy a "resumé"
konrad__ is now known as kmeyer
<Smerdyakov> kmeyer, what do you mean?
<kmeyer> Smerdyakov: "resumé" is always wrong
<context> ocaml needs readline support :x
<kmeyer> "résumé" if you're being all proper French, "resume" if you're "American", but "resumé" is wrong either way.
<kmeyer> if I'm remembering wrong, please correct my understanding :)
<Smerdyakov> kmeyer, thanks. I'll change it.
<Smerdyakov> kmeyer, or maybe not.
<kmeyer> I'm a miniature grammar/spelling nazi
<kmeyer> heh
<Smerdyakov> kmeyer, Wikipedia gives my spelling as valid.
<kmeyer> the title of the article is "Résumé"
<Smerdyakov> Keep on reading.
<kmeyer> just because people often misspell it that way doesn't make it correct.
<Smerdyakov> Wikipedia doesn't list as a misspelling.
<kmeyer> Notice the bit about wiktionary off to the right
<kmeyer> wikipedia isn't a dictionary
<kmeyer> see: wiktionary
<kmeyer> bleh, they define resumé
<kmeyer> It's wrong.
<Smerdyakov> Sorry, my prescriptivist friend.
<kmeyer> the masses are always wrong :)
<Jeff_123> to bad. in the end the masses define the langauge
buluca has quit ["Leaving."]
<Smerdyakov> The importance of the accent in "resume'" is to disambiguate from "resume." It doesn't really matter what the French word is.
<Jeff_123> Merriam Webster says "resume" is a "variant."
<kmeyer> too bad the masses are using "lol" and "omgz" in internet communications
<kmeyer> I will cry the day those are sanctioned by a major dictionary
<Jeff_123> hah
<Jeff_123> probably they're enough of a fad that they wont make it
Demitar has joined #ocaml
wy has joined #ocaml
dbueno has quit [Read error: 104 (Connection reset by peer)]
dbueno has joined #ocaml
dbueno has quit [Read error: 104 (Connection reset by peer)]
hsuh has quit [Remote closed the connection]
wy has quit [Remote closed the connection]
magnus_ is now known as magnusjonsson
<Jeff_123> context, how goes the fight?
wy has joined #ocaml
magnusjonsson is now known as magnusj
<kmeyer> no
<Smerdyakov> Oh. Minus 10 coolness points.
<kmeyer> I'm mostly active on the ruby-talk mailing list and do a bit with fedora
<Smerdyakov> Ruby? Bleh.
<Jeff_123> hehe
wy has quit [Remote closed the connection]
<Jeff_123> does ruby have any functional-like abilities? I noticed Python has list comprehensions.
Tetsuo has joined #ocaml
Tetsuo has quit [Client Quit]
<kmeyer> Jeff_123: probably not
<Smerdyakov> Ruby has some goofy sort of functional stuff, I hear.
wy has joined #ocaml
dbueno has joined #ocaml
ser_ has joined #ocaml
ser__ has joined #ocaml
ser_ has quit [Read error: 104 (Connection reset by peer)]
wy has quit [Remote closed the connection]
<Jeff_123> at least c# has some type inference now. It always pissed me off that in c++ I had to type "int[] = new int[500]" or somesuch.
ser__ has quit [Remote closed the connection]
<cygnus_> what is a sum type in ocaml?
<cygnus_> i was reading something and it talked about it i think it was saying a List is one
<cygnus_> is it just any algebraic data type ?
<Smerdyakov> Algebraic datatypes in OCaml combine sum, recursive, and product types.
<Smerdyakov> In type theory, the sum type [T1 + T2] is a tagged union of values from either [T1] or [T2].
<Jeff_123> so like A of int | B of string is a sum type?
<Jeff_123> (I just know how to use this stuff, i don't know the formalisms)
<Smerdyakov> You would need to be more specific about what type you mean. The fragment you gave isn't a valid OCaml type.
<Jeff_123> well I didn't give it a name...
<Jeff_123> let sometype = A of int | B of string
<Smerdyakov> And there are no anonymous variants in OCaml. You need polymorphic variants for that.
<Smerdyakov> If you change [let] to [type], then you have a variant type. The variant type mechanism in OCaml combines three kinds of types from type theory, like I said above, so it's not clear that it's right to call it "a sum type."
<Jeff_123> type sometype = A of int | B of string;;
<xavierbot> type sometype = A of int | B of string
<Jeff_123> Jeez, forgive a typo. I'm not an ocaml newbie you know.
<Jeff_123> :P
ser_ has joined #ocaml
ser_ has quit [Client Quit]
wy has joined #ocaml
Jeff_123 has quit ["Quit"]
<hcarty> context: If you're looking for readline support for the OCaml toplevel, try rlwrap
<Smerdyakov> Or, even better, Emacs!
<hcarty> rlwrap does have the benefit of being /slightly/ lighter
<hcarty> But yes, there is apparently some sort of similar support in emacs
<Smerdyakov> Most functional programmers are using Emacs already, so it's more heavy-weight to use rlwrap.
yminsky has joined #ocaml
yminsky has quit [Client Quit]
seafood_ has joined #ocaml
<cygnus_> Smerdyakov: what is a product type ?
<Smerdyakov> cygnus_, also known as "tuple types."
<cygnus_> so is type Boo = Ar of int | Ba of int*char
<cygnus_> is this a sum and product type ?
<Smerdyakov> There's no OCaml tuple type there, as OCaml has special support for multi-argument constructors.
<Smerdyakov> I would say that it's neither a sum nor product type, it's a variant type.
<Smerdyakov> Sums and products are involved in lower-level accounts of variant types.
<cygnus_> ok thx
<cygnus_> what is type theory used for ?
<Smerdyakov> For understanding programming languages
<Smerdyakov> Type theories are also often used as programming languages.
<cygnus_> i lookd on wikipedia and it says it can replace set theory? but htat sounds weird
<Smerdyakov> Why does that sound weird?
<cygnus_> i guess because it's replacing math with a way of constructing types
<Smerdyakov> That's an odd statement. Why can't math be about types?
<cygnus_> i don't know
<Smerdyakov> A statement like "math is set theory" is way out of sync with the reality of mathematical practice.
<Smerdyakov> Set theory is one post-hoc formalism applied to math practice.
<Smerdyakov> Type theory is another, with many advantages over set theory.
yminsky has joined #ocaml
yminsky has quit [Client Quit]
<cygnus_> that's cool
<wy> I'm trying an ocaml ray tracer and got a problem.
<wy> What can I do if I have two conflicting libGL installed? libgl1-mesa-glx and xorg-driver-fglrx both have libGL, and they are referred by libglut.so. So I got flickering display.
<tsuyoshi> what does ldd say
<tsuyoshi> it seems unlikely that two conflicting libraries would just give you a flickering display
<wy> I found the problem is with compiz
<wy> tsuyoshi: ldd says: libGL.so.1.2 => /usr/lib/libGL.so.1.2 (0xb7eb5000)
dbueno has quit ["This computer has gone to sleep"]
<wy> It's a little strange so many packages depend on mesa...
Mr_Awesome has quit ["aunt jemima is the devil!"]
jonafan has quit [Nick collision from services.]
jonathanv has joined #ocaml
<wy> I got a warning "/usr/bin/ld: warning: libGL.so.1, needed by /usr/lib/gcc/i486-linux-gnu/4.1.3/../../../../lib/libglut.so, may conflict with libGL.so.1.2". But libGL.so.1 is actually a symbol link to libGL.so.2. Is it normal for ocaml?
<tsuyoshi> that's not really an ocaml issue
<wy> tsuyoshi: ld issue?
<flux> context, install rlwrap: rlwrap ocaml
<tsuyoshi> wy: the problem is libglut is conflicting.. if that is installed via packages then either the packages or the package system are broken
Mr_Awesome has joined #ocaml
<wy> tsuyoshi: You mean my package system is broken?
<tsuyoshi> maybe.. it could just be one package that's missing conflict information
<tsuyoshi> or another package that's depending on the wrong thing
<wy> tsuyoshi: Can you specify to me what file should or should not exist?
<tsuyoshi> well.. ok, so if you link with libglut you get libgl.so.1
<tsuyoshi> and then for something reason it's linking with libgl.so.2 at the same time
<wy> My libGL.so.1 is a symbol link. Is it the same in yours?
<tsuyoshi> presumably they are incompatible because of the different versions
<wy> a symbol link to libGL.so.1.2
<tsuyoshi> I don't have any libGL installed
<wy> I'll try reinstall the package
<wy> The problem is gone!
<cygnus_> how can i show the dffinition of a type ?
<cygnus_> from ocaml top level
ser_ has joined #ocaml
ser_ has quit [Client Quit]
<flux> you can't. however, if it's in a module, you can do this: module Foo = TheModule
<flux> and it'll output the module signature
TaXules has quit [Remote closed the connection]
TaXules_ has joined #ocaml
<flux> also there's a project that has an extended ocaml toplevel with features (I think..) such as that
<cygnus_> neat
wy has quit [Remote closed the connection]
<cygnus_> i was trign to find out what 'option' type is
<cygnus_> cause i saw something do Some 7
<cygnus_> and it said it was int option
<cygnus_> but module Foo = Pervasives still doesnt show the option type i dont think
<flux> good point
<flux> must be something really built-in then
<flux> it's not in the index of types -part of the manual either
<flux> but for most intents and purposes it can be considered to be: type 'a option = None | Some of 'a
<flux> that's strange, I can't really any documentation on that type..
<flux> ah, manual033.html: the core library
<flux> it's listen in the list of builtin types
<flux> listed, even
<tsuyoshi> option is what's used for optional function arguments without a default, so it is pretty built in
<tsuyoshi> e.g. (fun ?foo () -> foo) is ?foo:'a -> unit -> 'a option
<cygnus_> ok ty
qpu has quit []
TaXules_ has quit [Remote closed the connection]
TaXules has joined #ocaml
piggybox has joined #ocaml
context has quit [Remote closed the connection]
context has joined #ocaml
mbishop has quit [Remote closed the connection]
mbishop has joined #ocaml
seafood_ has quit []
sergez_ has joined #ocaml
seafood_ has joined #ocaml
Associat0r has joined #ocaml
seafood_ has quit []
seafood_ has joined #ocaml
Snark has joined #ocaml
Associat0r has quit []
ygrek has joined #ocaml
ttamttam has joined #ocaml
seafood_ has quit []
yeoh has joined #ocaml
yeoh has left #ocaml []
yeoh has joined #ocaml
yeoh has quit ["ChatZilla 0.9.79 [Firefox 2.0.0.11/2007112718]"]
filp has joined #ocaml
asmanur has joined #ocaml
ygrek has quit [Remote closed the connection]
hkBst has joined #ocaml
<flux> hm, on ubuntu 6.10, how does one compile an lablgtk-app with the opengl widget? I have file /usr/lib/ocaml/3.09.2/lablgtk2/META.lablgtk2-gl, which says there's subpackage gtkgl, but ocamlfind list doesn't show it..
marmottine has joined #ocaml
<flux> symlinking that file to METAS directory made package lablgtk2-gl.gtkgl appear; maybe it's a packaging bug
bluestorm_ has joined #ocaml
<flux> some of the ubuntu debian packages are a bit broken, but perhaps the issues have been fixed in the more recent release
ygrek has joined #ocaml
Yoric[DT] has joined #ocaml
hkBst has quit ["Konversation terminated!"]
Amorphous has joined #ocaml
bluestorm_ has quit ["Konversation terminated!"]
<cygnus_> what does ~relif:`Sunken left
<cygnus_> the ` infront of Sunken mean?
<sergez_> 1: named arg with default; 2:variant tag; 3: at least that's what I think
bongy has joined #ocaml
buluca has joined #ocaml
<flux> cygnus_, google for ocaml polymorphic variants
<Yoric[DT]> cygnus_: polymorphic variants are an "advanced" form of variants with structural typing instead of nominal typing.
<Yoric[DT]> In particular, you can use `BlaBlaBla without having defined it.
love-pingoo has joined #ocaml
bluestorm_ has joined #ocaml
gim_ has joined #ocaml
<flux> I suppose there isn't a cgi-version of ocamlbrowser?
<Yoric[DT]> I remember someone asking about this on the OCaml mailing-list.
<Yoric[DT]> Actually, it was Jon Harrop and he wanted a JS version.
<Yoric[DT]> Either way, it doesn't seem to exist.
<Yoric[DT]> Unrelated question:
<Yoric[DT]> I'm writing a small lazy-list module.
<Yoric[DT]> When converting from a regular list, would you be eager (i.e. run through the whole list at once) or lazy (i.e. only convert the first element of the list and wait until the second element is needed before converting) ?
<bluestorm_> Yoric[DT]: being eager seems cheaper
<Yoric[DT]> Indeed.
<bluestorm_> (that would correspond to the optimization that always pre-force immediate values)
dbueno has joined #ocaml
<Yoric[DT]> Indeed, too.
<bluestorm_> so i'd be eager :p
<Yoric[DT]> :)
<bluestorm_> (observable behavior doesn't change anyway)
<Yoric[DT]> Well, I guess it depends how you're using the list.
<Yoric[DT]> If you're using it as some kind of stream, observable behavior will change.
<bluestorm_> ?
<bluestorm_> hm
<bluestorm_> how ?
<Yoric[DT]> Interleaving of operations will be different.
<Yoric[DT]> Assuming you're using the lazy list as a stream and you wish to run a number of stream filters.
<bluestorm_> yes but
<bluestorm_> how is the regular list concerned by interleaving ?
<bluestorm_> hm
<Yoric[DT]> Actually, you're right.
<Yoric[DT]> My bad.
<bluestorm_> on a different topic, being eager will require you to implement a hack to handle lazy-infinite-regular lists
<bluestorm_> being lazy may be simpler then
<Yoric[DT]> Lazy infinite regular lists ?
<Yoric[DT]> They exist ?
<bluestorm_> let rec ones = 1::ones;;
<xavierbot> val ones : 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;
<bluestorm_> :D
<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;
<Yoric[DT]> :/
<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;
<bluestorm_> ...
<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;
<bluestorm_> the regular toplevel use a print-depth limit
<bluestorm_> hm
<bluestorm_> not that low, though
<Yoric[DT]> xavierbot has a relatively low limit, iirc.
<Yoric[DT]> To prevent flooding.
<bluestorm_> seems it's still a little high, still
<bluestorm_> i think 2/3 lines would be enough
<Yoric[DT]> Ok, the module seems done.
<Yoric[DT]> Now, I can start thinking about Camlp4 :)
<Yoric[DT]> Any suggestion regarding the syntax of lazy lists ?
<Yoric[DT]> [- bla -] ?
<Yoric[DT]> [? bla ?] ?
<Yoric[DT]> [. bla .] ?
<Yoric[DT]> Probably not the last one, [.0;0.] might be a valid list.
<bluestorm_> :p
<Yoric[DT]> Well, turns out it isn't.
<Yoric[DT]> But still.
<Yoric[DT]> [~ bla ~] ?
<Yoric[DT]> [^ bla ^] ?
<Yoric[DT]> Any preference ?
<bluestorm_> not really
<bluestorm_> hm
<bluestorm_> iirc okasaki use $ as syntaxic sugar for lazyness
<bluestorm_> that gives an arbitrary coolness point to [$ .. $] :-'
<Yoric[DT]> That's one more than the others :)
<Yoric[DT]> erf
<Yoric[DT]> No $, that's already used for anti-quotations.
<bluestorm_> :p
<Yoric[DT]> Well, I'll start with ^ and improvise as needed.
zmdkrbou has joined #ocaml
ygrek has quit [Remote closed the connection]
ygrek has joined #ocaml
gim_ has quit [Read error: 110 (Connection timed out)]
gim_ has joined #ocaml
bongy has quit ["Leaving"]
buluca has quit [Read error: 113 (No route to host)]
qwr has quit [calvino.freenode.net irc.freenode.net]
qwr has joined #ocaml
love-pingoo has quit [calvino.freenode.net irc.freenode.net]
love-pingoo has joined #ocaml
love-pingoo has quit [calvino.freenode.net irc.freenode.net]
qwr has quit [calvino.freenode.net irc.freenode.net]
flux has quit [calvino.freenode.net irc.freenode.net]
Hadaka has quit [calvino.freenode.net irc.freenode.net]
mbishop has quit [calvino.freenode.net irc.freenode.net]
netx has quit [calvino.freenode.net irc.freenode.net]
xavierbot has quit [calvino.freenode.net irc.freenode.net]
Sparkles has quit [calvino.freenode.net irc.freenode.net]
RobertFischer has quit [calvino.freenode.net irc.freenode.net]
Mr_Awesome has quit [calvino.freenode.net irc.freenode.net]
Oatskool has quit [calvino.freenode.net irc.freenode.net]
seafood has quit [calvino.freenode.net irc.freenode.net]
mattam has quit [calvino.freenode.net irc.freenode.net]
pippijn has quit [calvino.freenode.net irc.freenode.net]
jlouis has quit [calvino.freenode.net irc.freenode.net]
richardw has quit [calvino.freenode.net irc.freenode.net]
bebui has quit [calvino.freenode.net irc.freenode.net]
__suri has quit [calvino.freenode.net irc.freenode.net]
gim_ has quit [calvino.freenode.net irc.freenode.net]
bluestorm_ has quit [calvino.freenode.net irc.freenode.net]
marmottine has quit [calvino.freenode.net irc.freenode.net]
kmeyer has quit [calvino.freenode.net irc.freenode.net]
pattern has quit [calvino.freenode.net irc.freenode.net]
unfo- has quit [calvino.freenode.net irc.freenode.net]
jdavis_ has quit [calvino.freenode.net irc.freenode.net]
rwmjones has quit [calvino.freenode.net irc.freenode.net]
DerDracle has quit [calvino.freenode.net irc.freenode.net]
gunark has quit [calvino.freenode.net irc.freenode.net]
Smerdyakov has quit [calvino.freenode.net irc.freenode.net]
cmeme has quit [calvino.freenode.net irc.freenode.net]
smimou has quit [calvino.freenode.net irc.freenode.net]
jeremiah has quit [calvino.freenode.net irc.freenode.net]
Demitar has quit [calvino.freenode.net irc.freenode.net]
cygnus_ has quit [calvino.freenode.net irc.freenode.net]
Yoric[DT] has quit [calvino.freenode.net irc.freenode.net]
tsuyoshi has quit [calvino.freenode.net irc.freenode.net]
acatout has quit [calvino.freenode.net irc.freenode.net]
opening has quit [calvino.freenode.net irc.freenode.net]
dbueno has quit [calvino.freenode.net irc.freenode.net]
magnusj has quit [calvino.freenode.net irc.freenode.net]
ecc has quit [calvino.freenode.net irc.freenode.net]
|Catch22| has quit [calvino.freenode.net irc.freenode.net]
jcpiza has quit [calvino.freenode.net irc.freenode.net]
dibblego has quit [calvino.freenode.net irc.freenode.net]
Snark has quit [calvino.freenode.net irc.freenode.net]
Proteus has quit [calvino.freenode.net irc.freenode.net]
eroyf has quit [calvino.freenode.net irc.freenode.net]
bla has quit [calvino.freenode.net irc.freenode.net]
ygrek has quit [calvino.freenode.net irc.freenode.net]
filp has quit [calvino.freenode.net irc.freenode.net]
piggybox has quit [calvino.freenode.net irc.freenode.net]
TaXules has quit [calvino.freenode.net irc.freenode.net]
pango has quit [calvino.freenode.net irc.freenode.net]
gim has quit [calvino.freenode.net irc.freenode.net]
hcarty has quit [calvino.freenode.net irc.freenode.net]
svenl has quit [calvino.freenode.net irc.freenode.net]
asmanur has quit [calvino.freenode.net irc.freenode.net]
ttamttam has quit [calvino.freenode.net irc.freenode.net]
sergez_ has quit [calvino.freenode.net irc.freenode.net]
jonathanv has quit [calvino.freenode.net irc.freenode.net]
gaja has quit [calvino.freenode.net irc.freenode.net]
kelaouchi has quit [calvino.freenode.net irc.freenode.net]
sergez has quit [calvino.freenode.net irc.freenode.net]
love-pingoo has joined #ocaml
qwr has joined #ocaml
gim_ has joined #ocaml
ygrek has joined #ocaml
dbueno has joined #ocaml
bluestorm_ has joined #ocaml
Yoric[DT] has joined #ocaml
marmottine has joined #ocaml
asmanur has joined #ocaml
filp has joined #ocaml
ttamttam has joined #ocaml
Snark has joined #ocaml
sergez_ has joined #ocaml
mbishop has joined #ocaml
piggybox has joined #ocaml
TaXules has joined #ocaml
Mr_Awesome has joined #ocaml
jonathanv has joined #ocaml
Demitar has joined #ocaml
magnusj has joined #ocaml
kmeyer has joined #ocaml
pattern has joined #ocaml
DerDracle has joined #ocaml
cygnus_ has joined #ocaml
pango has joined #ocaml
Sparkles has joined #ocaml
netx has joined #ocaml
xavierbot has joined #ocaml
RobertFischer has joined #ocaml
mattam has joined #ocaml
richardw has joined #ocaml
bebui has joined #ocaml
Oatskool has joined #ocaml
seafood has joined #ocaml
__suri has joined #ocaml
pippijn has joined #ocaml
jlouis has joined #ocaml
unfo- has joined #ocaml
Smerdyakov has joined #ocaml
jdavis_ has joined #ocaml
cmeme has joined #ocaml
gunark has joined #ocaml
jeremiah has joined #ocaml
rwmjones has joined #ocaml
smimou has joined #ocaml
ecc has joined #ocaml
dibblego has joined #ocaml
|Catch22| has joined #ocaml
jcpiza has joined #ocaml
tsuyoshi has joined #ocaml
acatout has joined #ocaml
opening has joined #ocaml
Proteus has joined #ocaml
flux has joined #ocaml
Hadaka has joined #ocaml
gaja has joined #ocaml
kelaouchi has joined #ocaml
sergez has joined #ocaml
gim has joined #ocaml
eroyf has joined #ocaml
hcarty has joined #ocaml
bla has joined #ocaml
svenl has joined #ocaml
dbueno has quit ["This computer has gone to sleep"]
Proteus has quit ["Leaving"]
kreaturr has joined #ocaml
bluestorm_ has quit [Remote closed the connection]
ertai has joined #ocaml
bongy has joined #ocaml
buluca has joined #ocaml
ertai_ has joined #ocaml
ertai has quit [Read error: 113 (No route to host)]
ttamttam has left #ocaml []
dbueno has joined #ocaml
pango has quit [Remote closed the connection]
sergez has quit [Read error: 110 (Connection timed out)]
pango has joined #ocaml
caprax has joined #ocaml
caprax has left #ocaml []
armerf has joined #ocaml
<armerf> pippijn, can you talk more about Q programming language?
<Smerdyakov> I remember seeing that somewhere. I didn't really know what to make of it.
<armerf> ok. if you say something. i will read it. thanks in advance.
armerf has quit ["ERC Version 5.1.2 $Revision: 1.796.2.4 $ (IRC client for Emacs)"]
<Smerdyakov> armerf, and pippijn is a Q advocate?
<flux> apparently glade-generated guis work fine with ocaml; nice to know if I ever really need to do something like that
<flux> atleast it's more convenient than constructing the gui by hand in the code
<Smerdyakov> flux, I find that it's more convenient to create GUIs in code with automatic layout engines than to use a GUI designer.
<flux> smerdyakov, I guess that is true. I however don't have such an automatic layout engine at hand.
<Smerdyakov> flux, lablgtk
<flux> hm, so how automatic is it?
<Smerdyakov> Completely
<Smerdyakov> In that you specify your layout with various containers that you pack things inside. No manual coordinates/.
<flux> smerdyakov, you do realize that glade actually uses vboxes and hboxes etc, so it still allow automatic layouting?
<flux> it doesn't use fixed coordinates (well I suppose that's possible too)
<Smerdyakov> You talked about "glade-generated," so I assumed you were using some code-generating program.
<flux> glade is a gui for constructing GTK interfaces
<Smerdyakov> Ah, gotcha. Yeah, I prefer using Gtk directly.
<flux> interactively adjusting the fill, expand and padding-attributes perhaps gives a bit faster feedback
<flux> nothing wrong with directly using gtk though, and for my purposes that's more than sufficient; but there are programs that have tons of dialogs, and if I were to do something that required that kind of stuff, glade would perhaps be a tool I'd consider
<Smerdyakov> But you can't use combinator libraries, which is, to me, a clear net loss.
<flux> definitely if the gui was generated from the data model, that would be a win
<flux> not unlike the recent blog (by oleg?) about need-based web form generation
<Smerdyakov> Almost all GUIs can benefit from construction from combinator libraries.
<flux> but for it to produce results a human likes, I'd imagine it would need quite many parameters
<Smerdyakov> You're thinking at too high a level.
<Smerdyakov> I'm thinking of things like a kind of button with common "on click" handling that displays a custom label and runs some extra code on click.
<flux> like gtk?
<flux> infact isn't that how practically all gui libraries work
<flux> actually at the uni I had the course work was to add a dialog to an existing program (the course was labeled "program maintenance and evolution", and we were given the 50kloc program source code and some documentation, plus the task), and microsoft visual c++ 2005's (my first encounter with it..) dialog editor was quite nice
<flux> the new dialog had loads of buttons and the gui created the callback functions and hooked them to the events nicely for me; plus sprinkled "insert code here"-comments
<Smerdyakov> Imagine you write lots of buttons that, when clicked, do something and become disabled. They become enabled again after some event happens.
<pippijn> huh?
<flux> hmm, yes?
<Smerdyakov> With a GUI builder, you will write the basic boilerplate of this idea again and again.
<pippijn> hmm
<Smerdyakov> With a library function, you just pass the caption, what to do when clicked, and which signal indicates that the button should become enabled again.
<pippijn> I have to talk about the Q language?
<flux> well, you don't need to use the gui builder for everything
<flux> infact in the assignment I had 8 buttons with similar features
<flux> I could manually place the objects into an array and handle them more nicely
<Smerdyakov> flux, I'm suggesting that almost all GUI stuff is better written in code because of the chance to use such library functions. It's just your lack of imagination that leads you to think that the GUI builder provides an acceptable interface.
<flux> smerdyakov, do you think that most or even a u
<flux> a big number if guis need such features?
<Smerdyakov> Yes.
<flux> I must admit I don't much use GUI software beyond xemacs, firefox and thunderbird
<flux> thunderbird perhaps being the most dialog-happy
<flux> I guess its dialogs are described in XUL or something
keisukefukuda has joined #ocaml
<flux> a visual editor for such files could be useful for a developer; atleast it would allow another person (who is less of a developer) to change or even create new dialogs
<flux> perhaps even without the actual developer caring or knowing about it
<Smerdyakov> Those other people shouldn't be creating the dialogs.
<Smerdyakov> They aren't qualified to build GUIs productively.
<flux> well, the developer can fix what the other guy broke :)
<Smerdyakov> I'm not into that kind of workflow.
<Smerdyakov> Text is the best way of describing almost any kind of complicated artifact.
<Smerdyakov> Our brains are hardwired to work with abstractions in text.
<flux> do you place no value in visualization tools then?
<Smerdyakov> GUI editors provide no story for making it easier for you to write code. They tend to expect that you'll just add handlers to the visual widgets that they create.
<Smerdyakov> It's critical to program with combinators that produce behavior as well as appearance.
hkBst has joined #ocaml
<Smerdyakov> Many kinds of visualization tools are very useful, but for anything halfway program-like, text is king.
wy has joined #ocaml
ertai_ has quit [Read error: 113 (No route to host)]
wy has quit [Remote closed the connection]
wy has joined #ocaml
Anarchos has joined #ocaml
wy has quit ["Ex-Chat"]
<Anarchos> hello i noticed that in ocaml 3.10.0, the makefiles use a Makefile.shared in "otherlibs", which is unfortunately not recognized under my system
bluestorm_ has joined #ocaml
<Anarchos> so i need a workaround if someone knows one
<bluestorm_> (around what ?)
<Smerdyakov> What do you mean by "the makefiles"?
ttamttam has joined #ocaml
Anarchos has quit [Remote closed the connection]
Anarchos has joined #ocaml
Kerjean has joined #ocaml
Anarchos has quit [Read error: 104 (Connection reset by peer)]
wy has joined #ocaml
<Kerjean> sorry i bugged
<Kerjean> i get a 'multiple target patterns *** stop' in the unix folder when i type 'make'
Kerjean is now known as Anarchos
wy has quit [Remote closed the connection]
<Anarchos> Smerdyakov> are you still there ?
<Smerdyakov> I am soooo here.
<Smerdyakov> What do you mean by "the makefiles"?
<Anarchos> Smerdyakov the makefiles needed to compile ocaml : they now use parallel tasks
<Smerdyakov> Gotcha.
<Smerdyakov> I always use binary packages and can't comment on this.
wy has joined #ocaml
<Anarchos> sure, but there is no binary package for BeOS ;)
<Smerdyakov> Why are you using BeOS?
<Anarchos> Smerdyakov because i paid for it lol
<Smerdyakov> Sounds like a bad reason, but I'm not sure if you're serious.
<Anarchos> Smerdyakov > i was kidding... i found it is a good alternative to win and linux
<Smerdyakov> The lack of support from most projects seems a pretty strong reason against choosing it.
<Anarchos> Smerdyakov that seem a really good point. Anyway i always recompile ocaml with success on it since 3.0.6
wy has quit [Remote closed the connection]
Amorphous has quit [Read error: 104 (Connection reset by peer)]
Amorphous has joined #ocaml
montoya has joined #ocaml
<montoya> #load "camlp4o.cma";;
<montoya> open Genlex;;
<xavierbot> Characters 1-12:
<xavierbot> open Genlex;;
<xavierbot> ^^^^^^^^^^^
<xavierbot> Unbound module Genlex
<montoya> fra@debian:~/Desktop/ocaml$ ocamlc prova.ml
<montoya> File "prova.ml", line 1, characters 0-1:
<montoya> Syntax error
<montoya> :(
<montoya> why?
<bluestorm_> montoya:
<bluestorm_> #load is a toplevel directive
<bluestorm_> you should not use that in a file you want to compile with ocamlc/ocamlopt
<bluestorm_> remove it
<bluestorm_> and use
<bluestorm_> ocamlc camlp4o.cma ...
<bluestorm_> instead
<bluestorm_> (in the toplevel, you can do ocaml camlp4o.cma ... too, or #load "camlp4o.cma";; in the toplevel, after it has been started, and then #use "yourfile.ml";;)
<montoya> bluestorm_: :O
asmanur has quit [Read error: 110 (Connection timed out)]
<montoya> return String_val(callback2(*deriva_closure, String_val(f), String_val(d)));
<montoya> String_val...
<bluestorm_> main.cpp: In function ‘char* deriva(const char*, const char*)’:
<bluestorm_> use value deriva(const char*, char char*) ?
<bluestorm_> hm
<bluestorm_> hm
asmanur has joined #ocaml
<bluestorm_> never mind
<bluestorm_> looks like you shouldn't wrap f and d inside String_val
<bluestorm_> if you're calling a caml callback, it'll need the ocaml values, not the char *
<montoya> only "values" ?
<montoya> yes yes, I call caml callback
<montoya> It's possible to convert char* into values?
<bluestorm_> caml_copy_string
<montoya> YES!!!!
<montoya> thanks bluestorm_
<montoya> Dinner... 15-20 min :P
<bluestorm_> would be interesting to see some code
bluestorm_ has quit ["Konversation terminated!"]
bluestorm_ has joined #ocaml
ertai has joined #ocaml
hsuh has joined #ocaml
olleolleolle has joined #ocaml
<Anarchos> i did'nt find how not to use the shared makefiles , grrr
wy has joined #ocaml
bongy has quit [Read error: 110 (Connection timed out)]
dibblego has quit [Nick collision from services.]
dobblego has joined #ocaml
olleolleolle has quit []
ertai has quit [No route to host]
hsuh has quit [Remote closed the connection]
Anarchos has quit ["Vision[0.8.5-0418]: i've been blurred!"]
zxczxc has joined #ocaml
zxczxc has left #ocaml []
asmanur has quit [Remote closed the connection]
Snark has quit ["Quitte"]
<montoya> I have this type
<montoya> It's possibile to convert expression into string?
<montoya> Const c -> string_of_float(c)
<montoya> Var v -> v
<montoya> Sum(f, g) -> "(" ^ f ^ " + " ^ g ^ ")"; <---- is wrong :(
<Smerdyakov> The lines you just included aren't an OCaml program.
<hcarty> montoya: I think you'd want something like ... | Sum (f, g) -> "(" ^ string_of_expression f ^ ... and so on
<hcarty> f and g would not be strings, so they still have to be converted
<montoya> hcarty: convert... how to convert expression into string?
<Smerdyakov> montoya, this is for a class, right?
<montoya> no class
<Smerdyakov> montoya, what source are you using to learn OCaml?
<montoya> material of my prof
<Smerdyakov> montoya, then it sure sounds to _me_ like this is for a class. Maybe it's a language problem? If I said "course" instead of "class," would you then answer "yes"?
<montoya> Notes
<Smerdyakov> OK, seeeerious language problem.
<Smerdyakov> Please, do everyone a favor and ask your professor instead.
<montoya> :(
<Smerdyakov> You may find it useful to complain to your university's administration that the professor is expecting you to learn ML programming with insufficient guidance from him, if that is the case. (It often is.)
<Smerdyakov> Alternatively, ignore your professor's notes and sit down with a good online tutorial.
<montoya> yes Smerdyakov
noj has joined #ocaml
<montoya> my solution: http://rafb.net/p/bJDgO686.html
<bluestorm_> to much "(" + print f + symb + print g + ")"
<bluestorm_> use an auxiliary function
<bluestorm_> (s/to/too/)
ygrek has quit [Remote closed the connection]
<bluestorm_> too much "(" ^ func_name ^ print f ^ ")" too
<bluestorm_> your auxiliaries function may be set as mutually recursive functions, wich are quite funny to use
<montoya> d[cos(x) + 3]/dx = ((-1. * (1. * sin(x))) + 0.)
<montoya> [20:50] <bluestorm_> would be interesting to see some code -> http://localhostr.com/files/3ea4451c6075786b653c.gz
<bluestorm_> noon time
marmottine has quit ["Quitte"]
bongy has joined #ocaml
filp has quit ["Bye"]
ttamttam has left #ocaml []
jhome has joined #ocaml
bongy has quit [Read error: 110 (Connection timed out)]
<Yoric[DT]> mmmhhhh....
* Yoric[DT] wonders how to chain Camlp4 extensions.
<Yoric[DT]> Especially when some are designed for original syntax and others for revised...
gim_ has quit ["bn"]
<bluestorm_> Yoric[DT]: "you can't" ? :p
<Yoric[DT]> Probably not.
<bluestorm_> you can chain extensions defined on the same syntax, if they do not conflict
<bluestorm_> and you might design extensions for both syntaxes
<bluestorm_> (i've tried but it's difficult, the grammar impl. is not high-level enough)
<Yoric[DT]> Thing is I've added this syntax for lazy lists.
<Yoric[DT]> (along with comprehension, cross-comprehension, etc.)
<Yoric[DT]> It would be nice to have pattern-matching on lazy lists.
<Yoric[DT]> Now, there's a lazy-pattern-matching extension which looks quite nice.
<Yoric[DT]> Unfortunately, it's designed for the original syntax.
<Yoric[DT]> I'm working with the revised syntax.
* Yoric[DT] could convert his sample to original syntax, though.
<pippijn> does anyone here know what rewriting logic is about?
harlos has joined #ocaml
* Yoric[DT] will remain silent
montoya has quit [Remote closed the connection]
xavierbot has quit [Remote closed the connection]
rwmjones has quit [Remote closed the connection]
harlos has left #ocaml []
seafood_ has joined #ocaml
qpu has joined #ocaml
smimou has quit ["bli"]
wy has quit [Remote closed the connection]
love-pingoo has quit ["zzz"]