dan2 changed the topic of #ocaml to: OCaml 3.08.2 available! | Archive of Caml Weekly News: http://sardes.inrialpes.fr/~aschmitt/cwn/ | A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ | A free book: http://cristal.inria.fr/~remy/cours/appsem/ | Mailing List: http://caml.inria.fr/bin/wilma/caml-list/ | Cookbook: http://pleac.sourceforge.net/
zzorn_afk has quit ["They are coming to take me away ha ha"]
neale has joined #ocaml
<judge> how can I use my own types in .mly files?
<judge> say i have a type t = Data of string | Empty
vinvin has joined #ocaml
<judge> where would i define it so i can parse and construct expressions of type t
<vinvin> hi
<vinvin> is it possible to overwrite a variable value ?
<vinvin> something like scheme's set!
<Nutssh> Only if its a reference.
<vinvin> :/
<Riastradh> Variables are immutable in OCaml.
<Nutssh> Whats the problem?
<vinvin> i'm trying with ref maybe it will work
<vinvin> i need a gensym
<Nutssh> Ref's what you want for that.
<vinvin> never mind
<vinvin> ok
xingshter has joined #ocaml
<xingshter> yodyodsyd
<xingshter> ydydf
<xingshter> g
<xingshter> dfg
<xingshter> d
<xingshter> gfd
<xingshter> g
<xingshter> fd
<xingshter> gfg
<xingshter> f
<xingshter> gf
<xingshter> gf
<xingshter> gf
<xingshter> fg
<Riastradh> ...?
<xingshter> y'all know sheen?
xingshter has left #ocaml []
Herrchen has joined #ocaml
vinvin has quit ["((lambda L (apply string L)) #\c #\y #\a)"]
bzzbzz has quit ["leaving"]
Hanji has left #ocaml []
monochrom has quit ["Few people understand "understanding"."]
mrsolo has quit ["Leaving"]
mrsolo has joined #ocaml
tintin` has joined #ocaml
cjohnson has quit ["sleep"]
tintin has quit [Read error: 110 (Connection timed out)]
vezenchio has quit ["Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specif]
gim_ has quit []
Herrle has joined #ocaml
Herrchen has quit [Read error: 60 (Operation timed out)]
Herrle is now known as Herrchen
mbh has quit [Read error: 110 (Connection timed out)]
mbh has joined #ocaml
Svrog has joined #ocaml
Svrog has left #ocaml []
Svrog has joined #ocaml
Austin has joined #ocaml
vezenchio has joined #ocaml
neale has quit [Read error: 60 (Operation timed out)]
Svrog has quit [" HydraIRC -> http://www.hydrairc.com <- *I* use it, so it must be good!"]
Hipo has quit [Remote closed the connection]
Hipo has joined #ocaml
neale has joined #ocaml
mrsolo has quit [Read error: 60 (Operation timed out)]
tintin` has quit [Read error: 54 (Connection reset by peer)]
Submarine has joined #ocaml
mlh has joined #ocaml
tintin has joined #ocaml
zzorn has joined #ocaml
zzorn_ has joined #ocaml
zzorn_ has quit [Remote closed the connection]
mlh has quit [Client Quit]
gim has joined #ocaml
vezenchio has quit ["Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specifi"]
Robert has joined #ocaml
<Robert> Hi. I'm planning to write a simple electrical circuit simulator, and was thinking about using OCaml for it. However, I don't know which data structure that could best represent a circuit.
<Robert> And I'm hoping for suggestions.
mellum has quit [Read error: 60 (Operation timed out)]
mellum has joined #ocaml
<pango> Robert: What about storing components, with their parameters, including inputs and outputs (mutable references to other components)...
<Robert> Could I store a sort of (static and mutable) "web" of components and their connections?
<Robert> Since the structure won't have to change after the simulation has started.
<Robert> And if that's possible - how is it done?
<pango> yes... only components will have internal state, right ?
<Robert> Er, what?
<pango> wires will have no state I suppose
<Robert> No, I'm thinkig of wires as "references" from one component to another.
<pango> exactly
<Robert> So how could this look in OCaml?
<pango> maybe an "object" approach would be better...
<vincenz> I fail to see the reason why you're looking so much at the language; Robert
<vincenz> just do how you would do; and then look at the language
<vincenz> a language is a tool, not a straightjacket
<Robert> I know it's a tool, but if I don't know how to use the tool there will be no product.
<Robert> pango: Thanks.
<mflux> if performance is to be worried about, I would propably pick non-objects though
<Robert> Yes, I'll do without the objects.
<Robert> One question about the code posted: the number of connections from a given component may of course be variable. Can I make a list of references as well?
<Robert> And how would it be declared?
<mflux> int reference is declared int ref, int list, well, int list and such a list would be int ref list..
<vincenz> mflux: I tested once...objects have very little overhead
<mflux> vincenz, I think the language shootout had some tests which displayed otherwise, but maybe I remember wrong
<mflux> of course, it depends on how much other work the method does
<vincenz> yeah
<vincenz> I ahd quite computation intensive methods
<vincenz> but still...a few 10s of millions of calls
<mflux> non-method calls could be inlined too
<vincenz> not accross modules
<vincenz> sadly
<Robert> So if the basic data structure is "component", I could do "inputs : component ref list" ?
<mflux> shh, you'll wake the s-guy who tells that the s-language has full-program-compilers ;)
<mflux> robert, yes
<Smerdyakov> I'm already awake!
<Robert> Haha.
<Robert> mflux: OK, thanks.
<Smerdyakov> Robert, I would suggest looking at Concurrent ML.
<Smerdyakov> Robert, that should be much more natural than an ad-hoc solution with objects.
<Robert> Like I said, I'm not going to use objects.
<Smerdyakov> OK, or any other kind of ad-hoc solution!
<vincenz> Smerdyakov: concurrent ml?
<Smerdyakov> vincenz, I bet the web can explain it better than I can.
<vincenz> is it based on sml?
<Smerdyakov> The original is. The equivalent functionality is in the Event module of OCaml's thread library.
* vincenz nods
<vincenz> Smerdyakov: ever seen jocaml?
<Smerdyakov> No
CosmicRay has joined #ocaml
<mellum> Isn't there some built-in function that rounds a float to int?
<Smerdyakov> Probably floor and ceil.
<mellum> I guess int_of_float (x +. 0.5) is what I want.
<Smerdyakov> So you meant some particular rounding scheme?
<mflux> floor/ceil might return float too though?
<mellum> Smerdyakov: I guess so. In my language what floor and ceil do isn't called "rounding"
<Smerdyakov> Your language is filthy.
<mflux> infact in my language they would be called 'rounding down' and 'rounding up'
<mflux> but not plain 'rounding' ;)
xqw has joined #ocaml
xqw is now known as mw
<Smerdyakov> Your language smells faintly of mouldy bread.
Robert has left #ocaml []
<mellum> Well, some of the greatest mathematicians of all times spoke my language, so I'm not concerned ;)
<Smerdyakov> They spoke it because I paid them to speak it for my amusement.
<Smerdyakov> Isn't anyone going to POPL?!
pango is now known as pangoafk
CosmicRay has quit ["Leaving"]
pangoafk is now known as pango
Austin has quit [Read error: 110 (Connection timed out)]
CosmicRay has joined #ocaml
<mbh> POPL?
<Submarine> Principles Of Programming Languages, ACM conference
<Submarine> Smerdyakov, Not going - I don't have a paper this year, and I've got to be here to help organize VMCAI.
Austin has joined #ocaml
pango has quit [Nick collision from services.]
pango has joined #ocaml
mpc has joined #ocaml
mpc has left #ocaml []
<judge> Smerdyakov: gimme a link to your sml web stuff again please
Austin has quit [Read error: 60 (Operation timed out)]
<Smerdyakov> Submarine, the VMCAI page has bad links for Radhia Cousot and Élodie-Jane Sims.
<Submarine> Smerdyakov, their lab is being reorganized
rudiur has joined #ocaml
rudiur has quit []
smkl has joined #ocaml
monochrom has joined #ocaml
smimou has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
lurch_ has joined #ocaml
mrsolo has joined #ocaml
mrsolo has quit [Read error: 54 (Connection reset by peer)]
KrispyKringle has joined #ocaml
humasect has joined #ocaml
CrewdenX has joined #ocaml
ahenobarbus has joined #ocaml
cjohnson has joined #ocaml
shawn has joined #ocaml
ahenobarbus has left #ocaml []
stef_ has quit [Remote closed the connection]
stef_ has joined #ocaml
KrispyKr1ngle has joined #ocaml
KrispyKringle has quit [Nick collision from services.]
KrispyKr1ngle is now known as KrispyKringle
shawn_ has quit [Read error: 110 (Connection timed out)]
mw has quit [Read error: 110 (Connection timed out)]
drewr has joined #ocaml
lmbdwr has joined #ocaml
smimou has quit ["?"]
DeathWolf has joined #ocaml
<DeathWolf> yo all, i'm trying to run my ocaml programs from the command line without using a permanent toplevel(ie, like a script), so i tried 'cat file.ml | ocaml' or 'ocaml < file.ml' but both these generated stuff that would rewrite on it's own line, making it unreadable
<DeathWolf> so i tried mk
<DeathWolf> so i tried ocamlmktop
<DeathWolf> but it errors
<DeathWolf> (libcamlrun.a(sys.s.o)(.text+0x7):sys.c: undefined reference to `__errno' etc)
<Smerdyakov> Try 'ocaml file.ml'
<DeathWolf> that doesnt give much info
<Smerdyakov> Mine doesn't?
<DeathWolf> i mean it works
<DeathWolf> but i'd like as much output as toplevel's
<Smerdyakov> You won't get that.
<DeathWolf> because the error reporting seems to be more extensive in toplevel
<DeathWolf> making debug easier
<Smerdyakov> No.
<Smerdyakov> Get it working with whatever tools you want, and then you can run it with ocaml, or compile it with ocamlopt.
<Smerdyakov> You shouldn't get any new error messages if you've done it right.
<DeathWolf> ok
<Smerdyakov> I almost never use the toplevel; I just use ocamlopt, which generates just as good compile error messages as you'll be able to get.
<DeathWolf> yeah
<judge> Smerdyakov: your smlweb stuff is fairly amusing
<judge> i like it
* Smerdyakov arches an eyebrow at "fairly amusing."
<Smerdyakov> Either we have a language barrier problem or you just insulted me. :P
<drewr> ping judge
<judge> Smerdyakov: it's a good idea
<drewr> Um, /ping works better.
<judge> i'm just not too sure about this sml thing
<Smerdyakov> But you are sure about this OCaml thing?
* Smerdyakov runs away for half an hour.
<judge> ocaml is in debian and mandrake in useful form
<Smerdyakov> SML is in Debian in usefuler form.
<judge> i dunno, aparently my mdk smlnj is much too outdated
<judge> and various programs depend on various versions of compiler
<judge> but as a language, sml seems to be pretty nice
<judge> i like your smlweb approach too
<judge> more web frameworks should work as simple CGIs
<DeathWolf> hum anyone knows if there's a mastermind example/prog, i remember seeing one but i cant remember where
<KrispyKringle> what's mastermind?
lmbdwr is now known as mayhem
<judge> does anyone use ulex?
<judge> i get a funny error
<judge> Error while loading "/usr/lib/ocaml/camlp4/pa_o.cmo": interface mismatch on Grammar.
<judge> on compilation
Herrchen has quit ["bye"]
<judge> oops
<judge> works now
<judge> had a compiler version mismatch
<DeathWolf> [00:31:52] <KrispyKringle> what's mastermind? => a codebreaking game with an oracle who tells you how many of your letters are rightly placed and how many are good letters but wrongly passed
drewr has quit [Remote closed the connection]
drewr has joined #ocaml