Alpounet changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.1 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<jlkenyon> yeah, I've dug through a few of those but none seem to cross the lists, just iterate along them simultaneously
<jlkenyon> well, no biggy, its easy enough to write, thanks!
_unK has quit [Remote closed the connection]
jlkenyon has quit ["Leaving"]
zaemis has joined #ocaml
avsm1 has quit ["Leaving."]
munga has quit [Read error: 60 (Operation timed out)]
avsm has joined #ocaml
avsm has quit [Read error: 110 (Connection timed out)]
<det> Leonidas, you can pass a function to extract a field from a record
tmaedaZ0 is now known as tmaedaZ
avsm has joined #ocaml
Pimm has joined #ocaml
<olegfink> hm, it would be trivial to implement sml-like selectors (see http://www.mpi-sws.org/~rossberg/sml-vs-ocaml.html#records) in camlp4, hasn't this been done before?
maskd has quit ["maskd has no reason"]
Pimm has quit [Read error: 110 (Connection timed out)]
Ori_B has joined #ocaml
yakischloba1 has joined #ocaml
srcerer has quit [Remote closed the connection]
yakischloba1 has quit ["Leaving."]
<det> olegfink, Ocaml records are not like SML records
<det> SML records are structurally typed
<orbitz> what does that mean
<det> they dont need to be defined before use
<det> and names can overlap
<orbitz> ah, jealous
zhijie has joined #ocaml
<orbitz> so it's liek calsses in ocaml
<det> yeah
<det> the typing at least
<det> selectors in Ocaml wouldnt be a huge benefit, since you can use (fun x -> x.y) anyways
srcerer has joined #ocaml
<det> but I guess ocaml and sml records being different doesnt really apply here, so I retract that comment
valross has joined #ocaml
travisbrady has quit []
zaemis has left #ocaml []
ski_ has joined #ocaml
CcSsNET has quit [Client Quit]
shr3kst3r has quit [Read error: 60 (Operation timed out)]
shr3kst3r has joined #ocaml
fx___ has quit [Read error: 110 (Connection timed out)]
Modius has joined #ocaml
jonafan_ has joined #ocaml
jonafan has quit [Read error: 60 (Operation timed out)]
yakischloba has joined #ocaml
danblick has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
pad has quit [Remote closed the connection]
ulfdoz has joined #ocaml
ttamttam has joined #ocaml
ttamttam has quit ["Leaving."]
derdon has joined #ocaml
flux has quit [Remote closed the connection]
jonafan has joined #ocaml
gdmfsob has joined #ocaml
Submarine has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
flux has joined #ocaml
jonafan_ has quit [Read error: 110 (Connection timed out)]
fx_ has joined #ocaml
yakischloba has quit ["Leaving."]
naufraghi has joined #ocaml
joewilliams has quit ["Leaving..."]
<derdon> good morning
<derdon> I just learned about lazy expressions
ttamttam has joined #ocaml
<derdon> does anyone have or know a good example where they are required or where they should be used?
_zack has joined #ocaml
fx___ has joined #ocaml
<mrvn> For when you might need something evaluated that is expensive but are not sure.
<mrvn> and don't want to evaluate it twice
fx_ has quit [Read error: 110 (Connection timed out)]
<derdon> ah, ok
munga has joined #ocaml
Yoric has joined #ocaml
ikaros has joined #ocaml
Submarine has quit [Read error: 110 (Connection timed out)]
mal`` has quit ["Coyote finally caught me"]
mal`` has joined #ocaml
<yziquel> http://paste.lisp.org/display/93378 what is this NONA token?
<mfp> yziquel: non-associative(?)
<yziquel> mfp. ok. but why is this "foreign" NONA placed between two '['?
<yziquel> mfp: I haven't seen this construct in other syntax extensions.
<yziquel> mfp: by the way, great work.
<mfp> it defines a "level", allowing you to place new productions before/after it, and to restrict allowed rules somewhere else
<mfp> yziquel: oops, forgot to reply to your emails
maskd has joined #ocaml
<mfp> uh ignore that, it's not a level, just a named production; I must have picked it up from Camlp4OCamlRevisedParser.ml
* mfp 's camlp4 is a bit rusty
<mfp> Camlp4OCamlRevisedParser.ml is the only up-to-date Camlp4 documentation :-/
<fx___> mfp, sql parser in camlp4?
<yziquel> fx___: yes...
<yziquel> fx___: well, almost
_andre has joined #ocaml
<mfp> fx___: a relational algebra implementation in OCaml that can be mapped to SQL
<fx___> I see
<yziquel> fx___: would like to map in to MAL, "assembly"-like language for MonetDB.
<yziquel> instead of SQL. so i'm looking at the syntax extension to see what should be modified.
<fx___> I am parsing sql with menhir, not full sql of course - subset that I need
Pimm has joined #ocaml
valross has quit [Remote closed the connection]
<yziquel> mfp: ok, but why is there two successive '[' in camlp4? what's the use? why not only one?
<mfp> yziquel: I've always found it confusing too. One is for the level, another for the rule.
<mfp> I take that back, those "xxx" NONA do define non-associative levels. It's when you want to expand (reuse) an existent level that you do production: LEVEL "xxx"
<mfp> so the outer '[' encloses a production, and the inner "xxx" [ ] are for the levels
<mfp> for a given level, you can have several rules: "xxx" ASSOCIATIVITY [ ... | ... ]
<mfp> in practice, most of the time you have things like foo: [ [ ... -> ... | ... -> ... ] ] which defines an entry having an anonymous level with 2 rules
<yziquel> mfp: so if I have col_type: ["foreign" NONA [..., i get to do my_rule: LEVEL "foreign" [[... if i want to reuse the level defined by "foreign" in rule col_type. am i understanding you correctly?
<mfp> yziquel: almost, that'd be col_type: LEVEL "foreign" [ [ ... ] ]
<mfp> it's not reusing the rule in another entry, just expanding an existent level in an entry
<yziquel> mfp: ok. last question. what is SELF?
<mfp> it's the current entry
<mfp> for instance, in expr: you could have a rule like "("; p = SELF; ")" -> p
<yziquel> mfp: ok. so in your code, when you have FOREIGN, you're constructing the column record as if there were no FOREIGN, and then you tamper with it, witha {t with ... } construct. am i correct?
<mfp> yes, exactly
<yziquel> ok. cool. that willdefinitely help me get going. thanks.
ikaros has quit ["Leave the magic to Houdini"]
<mfp> yziquel: the hardest area of relational/pa_relational by far is the type checking: I use existential types (encoded using polymorphic record fields) and polymorphic variants to express subtyping
<mfp> then pa_relational generates code that will only type if the relational exprs are sound
<mfp> by using things like let foo = function `A -> () | `B -> () which accepts [<`A | `B]
<mfp> so if we carry such a function around, we can express that something is of type [< `A | `B]
<mfp> or function `A -> () | `B -> () | _ -> () : [> `A | `B ] -> unit for "at least A and B"
yziquel has quit [Ping timeout: 180 seconds]
onigiri_ has joined #ocaml
maskd- has joined #ocaml
maskd has quit [Read error: 60 (Operation timed out)]
maskd- is now known as maskd
gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | Inscription for OCaml Meeting 2010 is opened http://wiki.cocan.org/events/europe/ocamlmeetingparis2010
th5 has joined #ocaml
Pimm has quit [Read error: 110 (Connection timed out)]
munga has quit [Read error: 110 (Connection timed out)]
Pimm has joined #ocaml
ski_ has quit ["Lost terminal"]
derdon has quit []
ski_ has joined #ocaml
munga has joined #ocaml
<Alpounet> If only it was in Marseille :-p
ksson has joined #ocaml
_zack has quit [Read error: 113 (No route to host)]
_zack has joined #ocaml
jimmyb2187 has left #ocaml []
tmaedaZ is now known as tmaedaZ0
derdon has joined #ocaml
jimmyb2187 has joined #ocaml
ikaros has joined #ocaml
deavid has quit [Read error: 60 (Operation timed out)]
companion_cube has quit [Read error: 60 (Operation timed out)]
mehdid has quit [Read error: 60 (Operation timed out)]
mrvn has quit [Read error: 60 (Operation timed out)]
mattam has quit [Read error: 60 (Operation timed out)]
optiz0r has quit [Read error: 60 (Operation timed out)]
companion_cube has joined #ocaml
deavid has joined #ocaml
mattam has joined #ocaml
mehdid has joined #ocaml
mrvn has joined #ocaml
optiz0r has joined #ocaml
danblick1 has joined #ocaml
munga_ has joined #ocaml
munga has quit [Read error: 110 (Connection timed out)]
flux has quit ["leaving"]
flux has joined #ocaml
joewilliams has joined #ocaml
<Leonidas> det: yep, that's what I will do. Good idea.
danblick has quit [Read error: 110 (Connection timed out)]
Spiwack has joined #ocaml
Snark has joined #ocaml
_zack has quit ["Leaving."]
_zack has joined #ocaml
_zack has quit [Client Quit]
_zack has joined #ocaml
_zack has quit [Client Quit]
_zack has joined #ocaml
rwmjones has quit ["This computer has gone to sleep"]
rwmjones has joined #ocaml
_unK has joined #ocaml
onigiri__ has joined #ocaml
Pimm has quit [Read error: 110 (Connection timed out)]
th5 has quit []
th5 has joined #ocaml
th5 has quit [Client Quit]
onigiri_ has quit [Read error: 113 (No route to host)]
ksson has quit ["leaving"]
avsm has quit ["Leaving."]
yakischloba has joined #ocaml
Associat0r has joined #ocaml
Waleee has joined #ocaml
brendan has quit [Read error: 101 (Network is unreachable)]
fx___ has quit [Read error: 110 (Connection timed out)]
flux has quit [Read error: 60 (Operation timed out)]
flux has joined #ocaml
ttamttam has quit ["Leaving."]
Yoric has quit []
joewilliams has quit [Remote closed the connection]
onigiri__ has quit []
avsm has joined #ocaml
ikaros has quit ["Leave the magic to Houdini"]
pchickey has joined #ocaml
<pchickey> Hi, I'm new to Ocaml and troubleshooting a build which has an error message "Unbound variable Env.paparazzi_home"
<orbitz> pchickey: plop a testcase up
<pchickey> the software package (paparazzi.enac.fc) asks you to set (in the shell) the variable PAPARAZZI_HOME=/home/pat/paparazzi3 or whatever is appropriate
<pchickey> I'm not familiar with what the Env (object?) does
<orbitz> Env is likely a module
<pchickey> so somewhere in this software package I'm missing a declaration of Env
<pchickey> it isn't a builtin or anything like that?
<orbitz> Env is not a stnadard module
<thelema> Sys.getenv is the usual way to get environment variables
_zack has quit ["Leaving."]
avsm has quit ["Leaving."]
joewilliams has joined #ocaml
<pchickey> ok, i found a file that had been misplaced called env.ml
Associat0r has quit []
<pchickey> that should fix everything I suppose.
<thelema> yes
<thelema> it should satisfy the Env requirement
<pchickey> thanks for your help.
<thelema> you're welcome
Spiwack has quit ["Leaving"]
brendan has joined #ocaml
_andre has quit ["Lost terminal"]
ulfdoz has joined #ocaml
pchickey has quit [Remote closed the connection]
gdmfsob has quit [Read error: 104 (Connection reset by peer)]
ttamttam has joined #ocaml
pad` has joined #ocaml
demitar has joined #ocaml
derdon has quit []
derdon has joined #ocaml
derdon has quit [Client Quit]
djanderson has joined #ocaml
Snark has quit ["Ex-Chat"]
Submarine has joined #ocaml
jeddhaberstro has joined #ocaml
tmaedaZ0 is now known as tmaedaZ
ttamttam has quit ["Leaving."]
onigiri has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
yziquel has joined #ocaml
yakischloba has quit ["Leaving."]
ski_ has quit ["Lost terminal"]
Submarine has quit ["Leaving"]
<yziquel> how can you process a file through a camlp4 syntax extension and dump the result in another file?
<julm> yziquel: -printer o > new_file.ml
<yziquel> julm: could you be a bit more specific?
<julm> well pass -printer o to camlp4
<julm> and use > to dump the output in a file
<julm> that's what you wanted?
<yziquel> julm: do not know how to use it, practically speaking.
<yziquel> julm: camlp4 pa_relational.cmo pa_relational_postgresql.cmo
<yziquel> No level labelled "top" in entry "str_item"
<yziquel> Failure: "Grammar.extend"
<julm> hm
<yziquel> in the toplevel, it works fine.
Pimm has joined #ocaml
<julm> where have you found pa_relational?
<yziquel> julm: ah, ok! camlp4o instead of camlp4...
<julm> ah yep
demitar has quit ["Ex-Chat"]
<julm> thx
<yziquel> and i've been dissecting what is postgresql specific into another pa_.cmo.
<julm> oki
<yziquel> julm: great. it now works...
<yziquel> thanks.
<julm> :)
deavid has quit ["No Ping reply in 180 seconds."]
deavid has joined #ocaml
jonafan_ has joined #ocaml
naufraghi has quit []
jonafan has quit [Read error: 60 (Operation timed out)]
<yziquel> i have <:expr< Relational.Typeconv.Postgresql.$lid:f$ >>. if i want to abstract away the module name by antiquotations, what should I use instead of $lid:...$?
ikaros has joined #ocaml
ikaros has quit [Read error: 104 (Connection reset by peer)]
<julm> yziquel: $id: ?
<julm> FWI: Camlp4.PreCast.Ast.ident = IdAcc of loc * ident * ident | IdApp of loc * ident * ident | IdLid of loc * string | IdUid of loc * string | IdAnt of loc * string
<julm> there also is a val ident_of_expr : expr -> ident that may be useful
Pimm has quit [Remote closed the connection]
<julm> and <:ident< of course