flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
AxleLonghorn has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
det has quit [Read error: 60 (Operation timed out)]
monadic_kid has quit ["Leaving"]
sOpen has quit ["Leaving"]
det has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
det has joined #ocaml
andrewschein has joined #ocaml
<andrewschein> a Khrabrov -- is that you?
Amorphous has quit [Read error: 110 (Connection timed out)]
alexyk has quit []
Amorphous has joined #ocaml
AxleLonghorn has left #ocaml []
<jli> can anything that returns a boolean go in a guard?
<jli> Erlang only allows built-ins in guards. I forget why.
<palomer> jli, anything
<jli> neat. thanks
<palomer> hmmmm
<palomer> is there a tutorial anywhere that shows how to use camlp4 to automatically generate functions to print your types ?
<jli> like sexplib?
<palomer> exactly!
<jli> ... :)
<palomer> the problem is that sexplib doesn't compile on my system
<palomer> or, rather, I don't feel like compiling type_conv
<palomer> hmmm
<jli> why don't you feel like it?
<palomer> i wonder where I can get older tarballs of sexplib
AxleLonghorn has joined #ocaml
<palomer> jli, because it's in apt
<palomer> I don't want to supplant my apt version
<jli> oh, heh. I didn't realize they made it into debian. neat.
<palomer> libtype-conv-camlp4-dev - support library for OCaml preprocessor type conversions
<jli> but you're supplanting your apt version of sexplib?
<palomer> jli, I would simply compile it, not install it
<palomer> compile it to make it the basis of what I'm trying to do
andrewschein has left #ocaml []
<jli> sorry, I don't understand
jamii has quit [Read error: 60 (Operation timed out)]
setlongjmp has joined #ocaml
<palomer> err, I want to make something _like_ sexplib, but not sexplib
<jli> oh, so you don't want sexplib at all
<palomer> right!
<palomer> (sexplib is in apt)
<jli> I thought you were writing a replacement because it wouldn't compile :)
<palomer> I guess I could just rewrite the Generate_sexp_of module in sexplib
Ched has quit [Read error: 101 (Network is unreachable)]
Ched has joined #ocaml
setlongjmp has left #ocaml []
alexyk has joined #ocaml
<palomer> hrmph
<palomer> is it possible to do something like module a : some_signature = struct ... end within constricting a to some_signature?
<palomer> http://pastebin.com/m4816e85a <-- do something like this
<AxleLonghorn> look good to me
<AxleLonghorn> *looks
<palomer> AxleLonghorn, gives a type error
<AxleLonghorn> what's the error?
<palomer> This expression has type int but is here used with type Foo.t
<AxleLonghorn> ah
<AxleLonghorn> gonna have to use a 'val create : int -> t' function
<AxleLonghorn> let _ = Foo.create 3
<palomer> http://pastebin.com/m612940b7 <-- what about this error?
<AxleLonghorn> sorry, you're going to have to post the error, I some how accidentally deleted my toplevel program
<AxleLonghorn> that second code is not the same as the first
<palomer> righto
<palomer> this one is simplified
<AxleLonghorn> secondly, you're trying to access the type from the inside of a functor
<palomer> I am??
<palomer> a is clearly outside the functor
<AxleLonghorn> the type isn't though
<AxleLonghorn> Foo.t doesn't exist yet
<palomer> ahh, righto:P
<AxleLonghorn> you have to give some module that adheres to the bar signature to Foo
<palomer> right right
<AxleLonghorn> like "module F (struct type t = string end)"
<AxleLonghorn> then say "let a : F.t ..."
<palomer> sml has two types of ascriptions, opaque and transparent
<palomer> ditto for ocaml?
<AxleLonghorn> do tell, I'm not familiar with sml
<palomer> well, module Foo : bar = struct ... end <-- Foo.t would be of type int
<palomer> but you could use Foo in a functor that requires a bar
<AxleLonghorn> yes, but since the bar signature makes t abstract, you aren't allowed to "use" it
<palomer> right
<palomer> but in sml a transparent ascription would not make it abstract
<palomer> I believe
<AxleLonghorn> how do you mean transparent?
<AxleLonghorn> "type t = int" vs "type t" ?
<palomer> module Foo : bar = struct type t = int end let a : Foo.t = 4 <--this would be correct code
<palomer> I believe that sml's transparent ascriptions would not abstract the types
xerxes_ has joined #ocaml
<mrvn> palomer: But bar specifically hides the type.
<AxleLonghorn> ok
<palomer> mrvn, not in sml (using transparent ascriptions)
<mrvn> palomer: That seems just wrong.
<AxleLonghorn> what's the syntax for that?
<AxleLonghorn> or is there a different syntax?
<mrvn> What if you don't write ": bar"?
<palomer> : is transparent
<palomer> :> is opaque
<AxleLonghorn> interesting
<mrvn> hmm, I thin in ocaml transparent is implicit while opaque is :
<mrvn> s/thin/think/
<palomer> well, you can omit the signature in sml too
<AxleLonghorn> yeah, that's the way it works so far as I know
<palomer> Does not have transparent signature ascription – use opaque ascription and with constraints
<palomer> what does "with" do?
<palomer> transparent ascription is just a compile check
<palomer> I guess
<mrvn> to make sure foo is a super signature of bar. Ocaml doesn't have that I think.
<palomer> ocaml doesn't have "with type" ?
<mrvn> palomer: how would that look to make a transparent foo : bar?
pants1 has joined #ocaml
<kaustuv> ocaml doesn't distinguish between datatype and type, so it doesn't need a withtype construct
<kaustuv> which is to say, it does have withtype.
<kaustuv> (unless you mean a signature 'S with type t = u', which is obviously also present in ocaml)
<AxleLonghorn> if you're looking for something between transparent and opaque though, there's a language extension introducing private types: http://caml.inria.fr/pub/docs/manual-ocaml/manual021.html#toc76
pants3 has joined #ocaml
<AxleLonghorn> does it fail?
<palomer> nope
<palomer> passes
<palomer> kaustuv, I meant S with type t = u
pants4 has joined #ocaml
<palomer> how can you have several type constraints?
<kaustuv> and type t' = u' ...
<kaustuv> err, drop 'type' there
<palomer> doesn't work
<mrvn> palomer: ahh, didn't know that "with" syntax. So that makes types transparent again after the : bar opaqued them.
<palomer> mrvn, righto
pants4 has quit [Read error: 60 (Operation timed out)]
pants4 has joined #ocaml
<AxleLonghorn> don't use parentheses
<mrvn> module type bar = sig type a type b end
<mrvn> module Foo : bar with type a = int and type b = int = struct type a = int type b = int end;;
<mrvn> module Foo : sig type a = int type b = int end
<AxleLonghorn> er, nevermind. what mrvn just posted
<kaustuv> huh, you need: S with type t = u with type t' = u'
<palomer> ahh, righto
<palomer> any other fancy module stuff I should know?
<AxleLonghorn> the ocaml manual has a lot of stuff in it related to modules
<AxleLonghorn> functors are apparently higher-order
<AxleLonghorn> and can be recursive
<AxleLonghorn> though I've never seen one in practice
xerxes has quit [Read error: 110 (Connection timed out)]
<palomer> I would use them if it wasn't for the fact that recursive modules have to be in the same file
<mrvn> That I hate too.
<AxleLonghorn> just gonna give a shout out to Ocamlgraph. I wouldn't have bothered to learn functors if it weren't for that library
pants2 has quit [Read error: 113 (No route to host)]
pants1 has quit [Connection timed out]
<palomer> im off to bed...night!
pants3 has quit [No route to host]
rjack has joined #ocaml
alexyk has quit []
ozzloy has quit [Read error: 60 (Operation timed out)]
ozzloy has joined #ocaml
alexyk has joined #ocaml
seafood has joined #ocaml
pants1 has joined #ocaml
xerxes_ has quit ["Ex-Chat"]
pants4 has quit [Read error: 113 (No route to host)]
bohanlon has quit [lindbohm.freenode.net irc.freenode.net]
gildor has quit [lindbohm.freenode.net irc.freenode.net]
hto has quit [lindbohm.freenode.net irc.freenode.net]
patronus has quit [lindbohm.freenode.net irc.freenode.net]
authentic has quit [lindbohm.freenode.net irc.freenode.net]
Mr_Awesome has quit [lindbohm.freenode.net irc.freenode.net]
Asmadeus has quit [lindbohm.freenode.net irc.freenode.net]
maskd has quit [lindbohm.freenode.net irc.freenode.net]
kaustuv has quit [lindbohm.freenode.net irc.freenode.net]
lanaer has quit [lindbohm.freenode.net irc.freenode.net]
munga_ has quit [lindbohm.freenode.net irc.freenode.net]
nimred has quit [lindbohm.freenode.net irc.freenode.net]
jonafan has quit [lindbohm.freenode.net irc.freenode.net]
javax has quit [lindbohm.freenode.net irc.freenode.net]
gl has quit [lindbohm.freenode.net irc.freenode.net]
brendan has quit [lindbohm.freenode.net irc.freenode.net]
aij has quit [lindbohm.freenode.net irc.freenode.net]
r0bby has quit [lindbohm.freenode.net irc.freenode.net]
ozzloy has quit [lindbohm.freenode.net irc.freenode.net]
Associat0r has quit [lindbohm.freenode.net irc.freenode.net]
palomer has quit [lindbohm.freenode.net irc.freenode.net]
bebui has quit [lindbohm.freenode.net irc.freenode.net]
ozzloy has joined #ocaml
palomer has joined #ocaml
Associat0r has joined #ocaml
bebui has joined #ocaml
kaustuv has joined #ocaml
lanaer has joined #ocaml
munga_ has joined #ocaml
gildor has joined #ocaml
maskd has joined #ocaml
hto has joined #ocaml
r0bby has joined #ocaml
patronus has joined #ocaml
nimred has joined #ocaml
jonafan has joined #ocaml
authentic has joined #ocaml
Mr_Awesome has joined #ocaml
bohanlon has joined #ocaml
Asmadeus has joined #ocaml
javax has joined #ocaml
brendan has joined #ocaml
aij has joined #ocaml
gl has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
alf has joined #ocaml
alf has quit ["Another good night not to sleep in a eucalyptus tree."]
AxleLonghorn has left #ocaml []
Camarade_Tux has joined #ocaml
alexyk has quit []
alexyk has joined #ocaml
Camarade_Tux has quit ["Leaving"]
erikl has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
angerman has joined #ocaml
rwmjones has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
Yoric[DT] has quit ["Ex-Chat"]
alexyk has quit []
seafood has quit []
hkBst has joined #ocaml
Yoric[DT] has joined #ocaml
Associat0r has quit []
s4tan has joined #ocaml
angerman has quit []
rwmjones has quit [Read error: 104 (Connection reset by peer)]
_zack has joined #ocaml
<Yoric[DT]> Mmmmhhh.....
<Yoric[DT]> I'm currently reviewing some code using Set with a [compare] function which does not define a proper order.
<Yoric[DT]> I suspect that's going to cause bugs.
<Yoric[DT]> (i.e. the function returns [0] if items are equal, [1] otherwise)
<Yoric[DT]> Has anyone met that case?
<mrvn> That should totaly throw of sets.
<mrvn> You need a "<" relation for the set.
<Yoric[DT]> That's what I suspected.
* Yoric[DT] wonders how I can represent a partial order.
<mrvn> only as heap
ulfdoz has joined #ocaml
<Yoric[DT]> Mmmhhhh....
<Yoric[DT]> That would probably be the right way of solving this.
<Yoric[DT]> For the moment, I'm using a hack.
<Yoric[DT]> (I'm extending the partial order into a total order using [compare])
<Yoric[DT]> ertai: ping
<ertai> Yoric[DT]: pong
ScrumMaster has joined #ocaml
<Yoric[DT]> One second, I was pinging on behalf of ScrumMaster.
<Yoric[DT]> (who's sitting right behind me)
<ScrumMaster> Hello there
<ScrumMaster> ertai: I was wondering, how is the order of the libraries on the command line decided by ocamlbuild ?
<ertai> the linker command line you mean ?
<ScrumMaster> yes
<ScrumMaster> because I have one library depending on another, so if they end up in the wrong order, it complains about undefined modules
<ScrumMaster> s/undefined/unimplemented/
<ertai> their is a topological sort done using the known dependencies
<ertai> if you get this error you probably need to add some dependencies
<ScrumMaster> I guess so: one of these libraries is built outside of ocamlbuild's scope and I am guessing it is causing the problem
<ScrumMaster> how can I add these dependencies ?
LeCamarade has joined #ocaml
<ertai> ScrumMaster: the lib built outside of ocamlbuild, is built before running ocamlbuild ?
<ScrumMaster> err, actually it is built by ocamlbuild launching a script in a sub-directory
<Yoric[DT]> (evil, evil)
<ScrumMaster> and has to be built in the middle of the process
<ScrumMaster> (Yoric: yes, I know=
<ertai> so ocamlbuild run a script that produce something in or out the project directory ?
<ScrumMaster> it does a cp of the subtree to _build and then runs the script
<ScrumMaster> which gives the dir/mylib.{a,cma,cmxa}
_zack has quit ["Leaving."]
_zack has joined #ocaml
rwmjones has joined #ocaml
seafood has joined #ocaml
Kerris7 has joined #ocaml
<ertai> ScrumMaster: I have to go, don't hesitate to ping me again
hkBst has quit [Remote closed the connection]
angerman has joined #ocaml
* Yoric[DT] just likes it when ertai gives complete answers :)
angerman has quit []
ScrumMaster has quit [Read error: 104 (Connection reset by peer)]
jamii has joined #ocaml
jonafan_ has joined #ocaml
jonafan has quit [Read error: 60 (Operation timed out)]
jonafan has joined #ocaml
* ertai is back
delroth has quit [Read error: 60 (Operation timed out)]
ScrumMaster has joined #ocaml
jonafan_ has quit [Read error: 113 (No route to host)]
Ariens_Hyperion has joined #ocaml
_andre has joined #ocaml
delroth has joined #ocaml
ulfdoz_ has joined #ocaml
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
seafood has quit []
munga has joined #ocaml
munga has quit ["Coyote finally caught me"]
noj has quit ["Changing server"]
noj has joined #ocaml
_andre has quit ["leaving"]
AxleLonghorn has joined #ocaml
kaustuv_ has joined #ocaml
bombshelter13_ has joined #ocaml
Ariens_Hyperion has quit [Read error: 110 (Connection timed out)]
_andre has joined #ocaml
peddie has quit [Remote closed the connection]
peddie has joined #ocaml
th5 has joined #ocaml
th5 has quit []
erikl has joined #ocaml
Snark has joined #ocaml
rjack has quit ["leaving"]
rjack has joined #ocaml
jeanbon has joined #ocaml
itewsh has joined #ocaml
erikl has quit [Read error: 60 (Operation timed out)]
erikl has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
itewsh has joined #ocaml
ulfdoz_ has joined #ocaml
LeCamarade has quit [Remote closed the connection]
ulfdoz__ has joined #ocaml
AxleLonghorn has quit [Read error: 110 (Connection timed out)]
rjack_ has joined #ocaml
rjack_ has quit [Client Quit]
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz__ is now known as ulfdoz
s4tan has quit [Read error: 110 (Connection timed out)]
ulfdoz_ has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
robocop has joined #ocaml
<robocop> hello.
<robocop> How I can simplify this code ?
<robocop> if if_f then try Hashtbl.find h a with _ -> Helper.found_h var_list a ("Unknow values "^a) err else Helper.found_h var_list a ("Unknow values "^a) err
<robocop> ( if a then (try b with _ -> c) else c )
Yoric[DT] has quit ["Ex-Chat"]
Associat0r has joined #ocaml
itewsh has quit [Connection timed out]
itewsh has joined #ocaml
ulfdoz_ has joined #ocaml
Alpounet has joined #ocaml
<Alpounet> ...
<hcarty> Alpounet: Interesting
<hcarty> It seems like something of an odd selection
<hcarty> Ocamlviz seems like it could be a useful tool though
<hcarty> I'm rather surprised that they chose another "from the ground up" plotting library
<hcarty> It is, of course, their money to fund what projects they see fit :-)
erikl has quit [Read error: 110 (Connection timed out)]
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
sporkmonger has joined #ocaml
<Alpounet> yeah
<Alpounet> but there's a binding of GnuPlot
<Alpounet> Moreover, that's not worth 3 months of work
<flux> I can easily see something nicer to use than GnuPlot could be around..
<Alpounet> but the selection has been made...
<Alpounet> flux, it was an example
<Alpounet> binding a plotting library isn't a 3 month work
<flux> I'm actually happy, because I could use an ocaml plotting library
<flux> depends on its capabilities
<flux> there must be more than 3 months work behind GnuPlot, after all :)
ScrumMaster has quit ["Lost terminal"]
<flux> in three months one should expect quite a complete and kick-ass plotting library, though..
<flux> ..too bad such libraries often turn out to be huge and unwieldy for the (small) task at hand
rjack has quit [Read error: 104 (Connection reset by peer)]
itewsh has quit [Read error: 110 (Connection timed out)]
itewsh has joined #ocaml
erikl has joined #ocaml
alexyk has joined #ocaml
rwmjones has quit ["Closed connection"]
jeanb-- has joined #ocaml
_zack has quit ["Leaving."]
fschwidom has joined #ocaml
itewsh has quit [Read error: 110 (Connection timed out)]
<aij> robocop: how about (try if a then b else raise Not_found with _ -> c) (* probably slower for the else case, but I'm guessing that's not a common path *)
<aij> robocop: also, it's generally bad style to catch all exceptions and assume they are the one you are expecting
itewsh has joined #ocaml
<robocop> okey, thanks aij.
<aij> for example, I expect you will get bewildering results if that is handling a Stack_overflow
jeanbon has quit [Success]
alexyk has quit []
<palomer> anyone know where the ocamldoc for type_conv is?
jeanb-- is now known as jeanbon
<hcarty> Alpounet: There's the gnuplot binding, PLplot which I wrote the bindings for, another PS/latex-based library which I don't remember the name of...
<hcarty> flux: I'd recommend the PLplot bindings for a start, if you want to make some plots :-)
<palomer> hrmph
<flux> hcarty, I've actually used a small piece of software I've written myself
<hcarty> flux: Very nice looking
fschwidom has quit [Remote closed the connection]
<jli> flux: what are the hour plots supposed to be?
<flux> the statistics how the door of a local computer club is open
<flux> in the 12-hour clock-face charts the white lines are day time, dark lines night time
<hcarty> Alpounet: One could definitely use up 3 months creating a nice OCaml'd plot interface to a plotting library. But I think, if plotting is the intent, then a focus on making a very nice interface to something which already exists would be a better use of time
<palomer> how do I use type_conv with omake?
<palomer> or, rather, how do I use camlp4 with omake?
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
komar___ has joined #ocaml
marmottine has joined #ocaml
<Alpounet> hcarty, moreover I don't understand why this one was far better than rejected propositions
<flux> maybe this one suited their needs better?
<Alpounet> that's the only reasonable explanation
<palomer> sexplib uses make, OCamlMakefile and omake
<palomer> nuts!
<jli> functions that take no useful argument have to be passed unit. is this because there's basically no syntax for function calls?
<jli> Alpounet: did you submit an application?
<mfp> palomer: OCAMLFLAGS += -pp "camlp4o whatever.cmo"
<mfp> camlp4o -I /appropriate/path foo.cmo or whatever
<mfp> OR, if the extension was installed with ocamlfind
<palomer> im writing the extension using type-conv
<mfp> OCAMLPACKS[] += thepackage and OCAMLFLAGS += -syntax camlp4o
<palomer> im trying to compile the extension and then use it in a test case
alexyk has joined #ocaml
komar_ has quit [Read error: 113 (No route to host)]
<Alpounet> jli, yes, I did, but I know of some applications that where far better than mine.
<Alpounet> (and rejected)
<mfp> palomer: yup, in an OMakefile of mine I have what amounts to OCAMLPACKS[] = sexplib.syntax OCAMLFLAGS += -syntax camlp4o
<mfp> also OCAMLDEPFLAGS += -syntax camlp4o required
<palomer> http://pastebin.com/mc372567 <-but then I get this error
<mfp> palomer: ah, if you aren't using an ext installed with ocamlfind you have to do it as I said above, with -pp "camlp4o ...."
<palomer> http://pastebin.com/m5dd7206c <-- this is my omakefile
<mfp> are you compiling the ext with camlp4orf?
<palomer> how do you do that with omake?
<mfp> you need a diff "section" to compile the extension with different OCAMLFLAGS
<mfp> as in http://pastebin.com/m64b6d4fa <- compiles pa_json_static.cmo
<mfp> for the example, you use OCAMLFLAGS += -pp "camlp4o -I the/path theext.cmo"
<mfp> outside the section
<palomer> the scope of the section is defined by indentation?
<jli> Alpounet: do you know how many proposals there were?
<mfp> palomer: yes
<Alpounet> jli, nope, they just said "more than we had expected"
<palomer> http://pastebin.com/m3f02284 <--- how do I make it build pa_test.ml ?
marmottine has quit [Read error: 110 (Connection timed out)]
<mfp> palomer: .SCANNER: scan-ocaml-%.ml: %.ml mysyntaxext.cmo
marmottine has joined #ocaml
<mfp> this builds the cmo before scanning for the deps
<hcarty> jli: The unit argument allows you to differentiate between a constant value and a function
<mfp> and thus before compiling
<hcarty> jli: Otherwise, how would you tell the difference between (let foo = "something") and (let foo () = "something")
<jli> hcarty: right, I was just making sure.
<mfp> palomer: does pa_test also use the type-conv syntax?
<palomer> mfp, yup
<palomer> pa_test does
<palomer> test just uses pa_test, nothing else
<palomer> got it to work!
<palomer> now, how do I do it with native code?
<mfp> really? I thought the -pp camlp4orf alone wouldn't be enough when building pa_test.cmo
<mfp> thought it'd choke on "type xxx = .... with ...."
<palomer> well...it fails to compile pa_test because of my own type errors
<palomer> do you have a simple type-conv example I could just plug in?
<mfp> native should be more or less the same, with .cmx instead of .cmo and OCAMLOPTFLAGS instead of OCAMLCFLAGS
<mfp> hmm actually, is there a syntax specified to type-conv at all?
<mfp> I thought it merely provided the hooks for other exts to define with xxxx
<palomer> hrmph, this is all new to me
<palomer> lemme work out a simple example
<palomer> shouldn't be too hard
alexyk has quit []
<mfp> just type foo = A with stuff
<mfp> should give you a Pa_type_conv: stuff is not a supported generator error
<mfp> when preprocessing with camlp4o
<palomer> but I have to write a correct pa_test.ml
<mfp> so camlp4o pa_type_conv.cmo pa_mystuff.cmo foo.ml should do
alexyk has joined #ocaml
<palomer> err, wait, lemme work out a pa_test
<palomer> do you know how to define a str_item literal?
robocop has quit ["Leaving."]
<mfp> like <:str_item< valud $lid:id$ = $expr$; >> ?
<mfp> *value
<palomer> Unbound value _loc
<palomer> <:str_item<"foo">> should also work, no?
<palomer> im looking for something of type (ctyp -> str_item) to call add_generator with
<palomer> (so I can see if I can compile pa_test)
<mfp> "foo" is not a str_item in revised syntax, is it?
<mfp> you need value x = y; or module A = struct ... end; or such
<mfp> right, unbound value _loc cause you need to let _loc = Loc.ghost or such before
<mfp> or propagate the _loc you get from the AST
<palomer> <:str_item<"foo">> seems to work
<mfp> weird; does that expand to "foo";; in original syn?
<jli> how do I get the system time? the Sys module doesn't seem to have anything related
<palomer> lemme check...
<palomer> how do you find out?
chahibi has joined #ocaml
<flux> jli, Unix.gettimeofday ()
<flux> and Unix.localtime
<mfp> camlp4o pa_type_conv.cmo pa_my_ext.cmo foo.ml where foo.ml has got with my_generator, registered in pa_my_ext.cmo
<palomer> pa_type_conv isn't in my cwd
<mfp> camlp4o -I somepath ....
<mfp> I don't know how to use extensions managed by ocamlfind (-syntax camlp4o) and local ones (-pp "camlp4o pa_myext.cmo") at a time
komar___ is now known as komar_
<palomer> http://pastebin.com/m776cbb23 <---output
<mfp> besides finding the -I path manually and doing everything by hand with -pp "camlp4o -I somepath pa_one.cmo pa_xxx.cmo"
<mfp> k, didn't know that values were valid str_items in revised syn
* mfp gtg
<jli> flux: thanks
* palomer still can't compile his test2.ml file with omake
Smerdyakov has joined #ocaml
kaustuv_ has quit [Read error: 113 (No route to host)]
Camarade_Tux has quit ["Leaving"]
alexyk has quit []
marmottine has quit [Read error: 110 (Connection timed out)]
vithos has joined #ocaml
kaustuv_ has joined #ocaml
alexyk has joined #ocaml
monadic_kid has joined #ocaml
Ched has quit ["Ex-Chat"]
Ched has joined #ocaml
jeanb-- has joined #ocaml
Ched has quit [Client Quit]
Ched has joined #ocaml
Snark has quit ["Ex-Chat"]
jeanbon has quit [Success]
Yoric[DT] has joined #ocaml
_zack has joined #ocaml
Associat0r has quit []
itewsh has joined #ocaml
rwmjones has joined #ocaml
<chahibi> Hello
<chahibi> what does type foo = {op:char;right: int; left:int}?
<chahibi> hmm sorry
<chahibi> too trivial to bother you
jeanb-- is now known as jeanbon
<Smerdyakov> Was that a real question?
ulfdoz_ has joined #ocaml
<jonafan> why would you represent a math expression that way
ulfdoz has quit [Read error: 60 (Operation timed out)]
ulfdoz_ is now known as ulfdoz
<Smerdyakov> jonafan, why would you ask a question without a question mark?
<jonafan> we've had this discussion before
<jonafan> it has to do with informality, nuance, and english syntax
<monadic_kid> is any of this helping anyone?
<jonafan> sentences that begin with "why" are questions, and sometimes you can turn a statement into a question by using a question mark instead of a period
<monadic_kid> chahibi: foo is a record type, like a stuct value-type
<chahibi> monadic_kid, yes, like a struct in c
<Smerdyakov> monadic_kid, that is not a helpful answer. The right helpful answer is that he should read an OCaml tutorial.
<chahibi> Smerdyakov, not necessarily
<Smerdyakov> monadic_kid, but the original question seemed to be missing some words for it to make sense as English, so who knows what he was really asking.
<chahibi> we are humans
<monadic_kid> chahibi: what was your question? what kind of type it is?
<chahibi> not stupid compilers
<chahibi> we can guess the mistakes
<Smerdyakov> chahibi, it's rude to expect other people to analyze your messages to understand them.
<kaustuv_> Smerdyakov: "what does foo?" is a common mistake for non-native speakers of English. He means "what does foo do?"
<chahibi> Smerdyakov, it is ruder to insist on that
<Smerdyakov> chahibi, there we must disagree.
<chahibi> Smerdyakov, we do
<monadic_kid> so anyways did you mean what kind of type it is?
<chahibi> monadic_kid, well, I am just discovering ocaml, and came through this type definition
<chahibi> monadic_kid, and dared to ask in this friendly channel
<chahibi> monadic_kid, but I got the answer when I searched a bit more :)
<chahibi> monadic_kid, yes, I understand it is the equivalent of the C "struct"
<chahibi> monadic_kid, the only strange thing is the "mutable" thing
<chahibi> monadic_kid, once we define something as "mutable", how can we modify it?
<kaustuv_> chahibi: it is best not to think in terms of C. Think of it more as a tuple whose components you can project by name.
<chahibi> monadic_kid, do we need to define a prefix like "->" ?
<chahibi> kaustuv_, yeah, a tuple indexed by names
<kaustuv_> chahibi: if you want mutable fields, such as: type foo = { mutable f : int }
<kaustuv_> Then to assign to the field f you would use foo.f <- 42 instead of foo->f = 42
<monadic_kid> you wanna tone down the use of mutables
<monadic_kid> i mean not use it much
<chahibi> yep
<chahibi> thanks kaustuv_
<chahibi> what is the use of these structures if they are not mutable?
<chahibi> in real life
<monadic_kid> grouping of data
<kaustuv_> chahibi: in real life, constants are not mutable. The value of pi does not change for the lifetime of the universe. Functional programming is kind of like programming with constants.
<chahibi> so they are just multi dimensional constants
<chahibi> I see that
<kaustuv_> The trick is to see that what you commonly think of as mutation can just be thought of as creating a new constant with a slightly different structure. Then a "sufficiently smart compiler and runtime" can remove the overhead of this abstraction.
<kaustuv_> The benefit of the abstraction being, mainly, that you don't lose your past work and can reuse it, ship it to other processors, etc.
<chahibi> What is wrong with this " > begin let a =5; let b =6; a+b ; end;;
<chahibi> " ?
<kaustuv_> I think you should follow Smerdyakov's advice and read an OCaml tutorial until you get the basic syntax.
<Smerdyakov> This is better, I think: http://files.metaprl.org/doc/ocaml-book.pdf
<chahibi> I am actually reading another tutorial which is not very clear
monadic_kid has left #ocaml []
<Smerdyakov> Then you should probably stop reading it.
<Smerdyakov> I only recommend the tutorial in the manual and Hickey's book.
<chahibi> well
<chahibi> begin let a = 5 in let b = 6 in a+b; end;;
<chahibi> works fine
<chahibi> how can I define global variables in a "begin ... end" ?
<chahibi> can I?
<chahibi> Smerdyakov, thanks for the link
<Smerdyakov> Which tutorial have you been reading?
<chahibi> the first one ever was http://www.ocaml-tutorial.org/
<chahibi> (french)
<Smerdyakov> Hm. I can't even read it, so I certainly can't vouch for it. :)
<chahibi> Why is not "begin let a =5 end;;" valid?
itewsh has quit [Remote closed the connection]
<chahibi> (note: I am on camllight)
<Smerdyakov> I'm not going to answer. You need to read a more principled, structured introduction to OCaml.
<Smerdyakov> Also, the only people who know anything about Caml Light are French professors and students, and I'm neither. :)
<chahibi> let's try it on ocaml then
<chahibi> so begin end can not encapsulate top-level assignments?
<hcarty> chahibi: As many others have said, you will be much better served by reading one of the mentioned tutorials
<Smerdyakov> You have a very basic misunderstanding.
<Smerdyakov> [let] has nothing to do with assignment in OCaml.
<chahibi> I would be glad to know straightly
<Smerdyakov> You would be glad, but you're not paying me enough to make it worth my while to keep answering your questions.
AxleLonghorn has joined #ocaml
AxleLonghorn has left #ocaml []
rjack has joined #ocaml
<chahibi> ah, nevermind if it is this way
<hcarty> chahibi: Why not take the 10-60 minutes required to read a tutorial?
<Smerdyakov> Everyone here is happy to answer questions that you couldn't answer yourself by spending some time with a tutorial.
<chahibi> weird, really
AxleLonghorn has joined #ocaml
AxleLonghorn has quit [Client Quit]
<hcarty> chahibi: This is also a useful quick intro to OCaml -- http://www.ffconsultancy.com/products/ocaml_for_scientists/chapter1.html
<chahibi> Thanks for the pointers
<hcarty> chahibi: Smerdyakov's suggestions are both better for really learning the language though.
* palomer thinks noone needs to pay to get answers
* palomer also thinks that the tutorials are a little hard at times
<palomer> chahibi, do you have a specific purpose for using ocaml?
<hcarty> palomer: The tutorials are, for some purposes, lacking. But there isn't a lot of point to walking someone through the basics of the language over IRC when there are existing sources which do it better.
<chahibi> palomer, just trying to learn functional programming, and one particular computer exam I want to take
<chahibi> it might be just the hard day I had, but I feel I am missing something
<palomer> chahibi, oh, then the tutorial is fine
<palomer> to answer your question: let <varname> = <expression> in <expression> is the correct syntax to use
<palomer> I see nothing wrong about asking small questions like chahibi is doing
<chahibi> yes, and I verified that before
<palomer> except in the toplevel, in which case let <varname> = <expression> is fine
<chahibi> so can I say that I can't declare global variables in a begin .. end
<chahibi> ?
<palomer> chahibi, there is no concept of global variables in haskell
<palomer> only of bindings
<Smerdyakov> palomer, you're free to set your own rules for when you answer questions. I have mine, and many others here follow similar rules. I do think you're doing him more harm than good by answering questions when it's clear he's spent minimal time reading an introduction to the language.
<palomer> Smerdyakov, and I think you're doing more harm than good by being so brusque, so we're even
<chahibi> I read an introduction to the language
<chahibi> I did, with the needed time and concetration
<Smerdyakov> palomer, I think a vote of the channel would lead to siding with me, unusually enough. :)
<chahibi> and doing the examples
<Smerdyakov> chahibi, you read what [let] is in that introduction?
<palomer> chahibi, err, you have to forget about global variables, think of let as giving a name to an expression
<Smerdyakov> palomer, there is no way you will be able to explain that concept on IRC to someone who doesn't already get it, or at least not with a single line.
<palomer> I can at least be a little encouraging and help him head in the right direction. I think "forget about global variables" to be a very useful thing to know
<Smerdyakov> No one will understand and follow that advice without a clear understanding of what to use instead, and that understanding can only come from reading a thoughtfully-written document.
<chahibi> it says that let name = expression in gives a name to an expression to be used in the following till ;;
<chahibi> and that global variable are defined using
<chahibi> let name = expressing ;;
<Smerdyakov> I hate learning materials that advise to use [;;]. >:[
<palomer> not everyone learns by reading documents, and not everyone who reads documents can absorb the material without a little helping hand
<chahibi> well, what I was trying to learn
<chahibi> is to see how begin ... end works
<chahibi> its exceptions
<chahibi> playing with it
<Smerdyakov> Anyone who can't learn by reading documents needs more help than you will be able to provide over IRC.
<chahibi> I read no where that you can't define global variables inside a begin end
<Smerdyakov> (And probably shouldn't be trying to learn OCaml, but sometimes it's worth learning anyway for social reasons.)
<palomer> let name = expression ;; binds name to expression at the toplevel. inside a begin...end, you cannot bind a name to an expression at the toplevel
<chahibi> palomer, ok, clear answer :)
<chahibi> palomer, now, fixing my apparently wrong learning method
<chahibi> palomer, how am I supposed to know that
<palomer> so let name = expression1 in expression2 binds name to expression1 in expression2
<Smerdyakov> chahibi, the OCaml manual includes a complete grammar of the language.
<Smerdyakov> chahibi, given that grammar, you can tell exactly which syntax is valid.
<chahibi> Smerdyakov, so are the channel users here supposed to know the complete reference manual before asking anything
<chahibi> ?
<Smerdyakov> chahibi, you should know how to check the manual to find an answer. That doesn't mean you ever memorize the manual.
<chahibi> Smerdyakov, this isn't what you were saying before, you said my questions implies I didn't read an ocaml tutoriam
<chahibi> Smerdyakov, and that it is a very basic principle, at least this is how I understood your reaction
rjack has quit ["leaving"]
<chahibi> I need to go now
<Smerdyakov> chahibi, yes. Every channel user is expected to know the basics of the language, and also how to check the manual for more specific answers.
<chahibi> Thanks all for the help and advices
<palomer> np
<chahibi> Smerdyakov, my question wasn't basic
<Smerdyakov> chahibi, yes, it was.
<Smerdyakov> chahibi, any question about syntax is basic, since context-free grammars define syntax unambiguously.
<Smerdyakov> (And CFGs are simple)
<palomer> I find reading context free grammars a little hard sometimes
<palomer> and if I didn't have a CS degree, I wouldn't be able to read them at all
<palomer> anyways, I don't think that everyone here should know the basics of the language; we accept enthusiastic beginners as well
<chahibi> Smerdyakov, is "let a = 4" an expression?
<Smerdyakov> I don't think anyone who finds it hard to learn to read CFGs shouldn't try to learn OCaml.
kaustuv_ has quit [Remote closed the connection]
<Smerdyakov> s/shouldn't/should
hkBst has joined #ocaml
kaustuv_ has joined #ocaml
<Smerdyakov> chahibi, you can check that for yourself with the grammar in the manual.
<Smerdyakov> chahibi, there's a section labeled "expressions."
<Smerdyakov> chahibi, and it gives the complete definition of that syntax.
slash_ has joined #ocaml
<palomer> the CFG is pages and pages of formalism
<chahibi> so it is not
<palomer> any human would find that hard to read
<gl> but ocaml users are not human, just ubermensch
<chahibi> Is this channel for the ocaml language development
<palomer> anyways, I don't think anyone should set limits on who should or should not learn ocaml
<chahibi> haha, ubermensch
<Smerdyakov> palomer, consulting the grammar is the best way to answer questions about syntax.
<Smerdyakov> palomer, do you know any happy OCaml user who finds CFGs tricky?
<hcarty> chahibi: What is so odd about being told "Your question is answered in any of these tutorials"?
<chahibi> add clearly in the channel topic "no ocaml syntax questions"
<chahibi> and for algorithmics, see elsewhere
<palomer> CFGs aren't conceptually tricky, but reading the CFG of a completely foreign language is.
<hcarty> chahibi: Lots of syntax and alogithm questions are asked and answered here
esope has joined #ocaml
<Smerdyakov> palomer, I don't agree, for a person who understands the formalism.
<hcarty> chahibi: But when the question is about getting started in the language, the tutorials will do a better job than just about anyone here has time to.
<gl> many ocaml users don't even bother to understand the formalism of bfg, anyway
<gl> cfg :)
<palomer> for example, chahibi has no concept of what an expression is or does. He'll learn by following tutorials, writing his own code and asking questions here. He certainly won't learn from reading a formal document.
<palomer> the CFG for Oz would certainly baffle me
<palomer> similarly, the PEG for lojban would baffle you
<Smerdyakov> palomer, it shouldn't after I read an introduction to the language.
cloudhead has joined #ocaml
<palomer> you'll have to read chapters and chapters before it starts making sense
<chahibi> hcarty, I am not completely getting started
<chahibi> hcarty, I read a manual, and solved many exercices
<chahibi> hcarty, like threads
esope has left #ocaml []
<chahibi> hcarty, and their thread balancement
<chahibi> hcarty, as well as a implementing operation on polynoms as lists
<chahibi> hcarty, and quickly!
<Smerdyakov> palomer, some things worth doing require a lot of reading.
<chahibi> hcarty, my mistakes was that I supposed let a = 5;; is an expression, which wasn't
<palomer> anyways, all I'm saying is that asking small questions is totally cool, pointing people to reference documents is also cool, but assuming that people haven't read any tutorials or telling people that you won't help them because they're not helping themselves is uncool
<chahibi> hcarty, and was in no way confronted to know that
<chahibi> hcarty, and I asked just out of curiosity about begin ... end
<palomer> not everyone has the patience, and you shouldn't assume that everyone should
<chahibi> hcarty, I don't usually use begin .. end in my code
<chahibi> Smerdyakov, did you learn english from a reference manual?
<chahibi> Smerdyakov, as if you started learning linguistics before human language
<palomer> I know some chinese and japanese people who learned english from books; they speak terribly (but can read/write)
<chahibi> Smerdyakov, that is the formal way, and in real life, it isn't the way people learn languages
* palomer was an english teacher
_zack has quit [Read error: 113 (No route to host)]
<Smerdyakov> chahibi, natural and computer languages are very different. The latter are designed to be learned relatively quickly by reading.
<chahibi> Smerdyakov, my point is that formality is not the only way to learn things, and not possible the most adapted to human mind
<hcarty> chahibi: begin .. end is something which would be covered in a good tutorial. And rules of scope seem to be fairly consistent across most commonly used languages.
<chahibi> Smerdyakov, perhaps to a machine
<Smerdyakov> chahibi, it is the best way to learn programming languages.
* palomer finds that the best way to learn programming languages is to write a project and ask questions along the way, assuming there are people to answer them
<gl> the best way when your iq is over 160; it's sad, but the mean is about 100.
<hcarty> palomer: That may be true, but sometimes the best "people" to ask are the documentation.
<chahibi> gl, proof?
<chahibi> gl, iq is a terrible intelligence estimator
<gl> i know
<chahibi> gl, define intelligence first
<palomer> hcarty, the documentation can be hard for a beginner
<gl> it was an analogy
<hcarty> palomer: I agree. But Hickey's book is less so, and Harrop's tutorial is VERY simple and direct.
<chahibi> gl, I am trying to be formal :p
<gl> i'm saying that the best way to many people is to try first, then read the doc; for super-smart people, the best way is to read the full standard/tutorial/whatever, then directly code an operating system
<chahibi> hcarty, should you really assume that people should know THE right tutorial? Really?
<chahibi> gl, yes, that is true
<gl> it would be cool if everyone was in the second category, but it's not real life
<chahibi> gl, some can learn languages using books
<hcarty> chahibi: No, which is why several people here suggested "THE right tutorial" to you.
<palomer> hcarty, try asking a question to a tutorial
seafood has joined #ocaml
<chahibi> gl, and others cassettes and interactive stuff
<hcarty> palomer: I do often quite often.
<palomer> hrmph, this debate is getting too vague
<palomer> but it just makes me so mad when people get put down for asking questions!
<hcarty> palomer: Interaction with other humans is important at times as well (otherwise why have #ocaml?), but search will generally find the answer rather quickly in a digital source.
<hcarty> palomer: It's not about asking questions
<hcarty> palomer: It's about ignoring the answers
<chahibi> palomer, the conclusion is that #ocaml is not for fanboys :)
<hcarty> palomer: I agree that "baby speak" should be as acceptable in OCaml (and #ocaml) as it is in the Perl community
<kaustuv_> fanboys? This is a programming language, not your latest pop idol sensation.
<chahibi> hcarty, when can ask ignoring the answer, there is no contradiction
<gl> xavier is my pop idol
<hcarty> palomer: However, some effort should be made by the user to follow advice from others.
<chahibi> "rtfm!" is clear
<chahibi> it is about the Manual :)
<kaustuv_> gl: Xavier might be worth idolizing, but he is so so so not pop
<hcarty> chahibi: I don't understand what you mean.
<palomer> hcarty, "follow these tutorials and you'll understand your the answer to your small question" can be quite discouraging
<palomer> s/your/
<hcarty> chahibi: RTFM may be useless, but RthisFM is generally not.
<chahibi> hcarty,* you can ask ignoring the answer, there is no contradiction
Ariens_Hyperion has joined #ocaml
<hcarty> chahibi: But why keep asking if the answers are going to be ignored?
<kaustuv_> congrats on your ICFP paper, btw, Smerdyakov.
<chahibi> hcarty, are you sure they are going to be ignored?
<chahibi> hcarty, how can you assume that
<hcarty> chahibi: No, I sincerely hope that they won't be ignored.
<Smerdyakov> kaustuv, thanks. Are you going?
<kaustuv_> I wish I had the time, but it conflicts with a job talk I have to give.
<Smerdyakov> kaustuv, bummer.
<hcarty> chahibi: But you continued to ask after being told "your questions are answered here."
<chahibi> hcarty, it depends on the person
<kaustuv_> But I am curious how Ynot++ (or whatever you call it) relates to the stuff Aleks Nanevski et al are doing in Cambridge
<chahibi> hcarty, I searched (read where begin .. end was defined, and where let was defined)
<hcarty> chahibi: And the questions illustrated misunderstanding of areas outside of the question itself.
<chahibi> hcarty, I had to read what statements are and what expressions are
<chahibi> hcarty, so the pointers were still quite vague
<palomer> gotta run
<gl> well, can we stop talking about that?
<chahibi> yes :)
<Smerdyakov> kaustuv, it's actually usable for real work. :P
<gl> thank you
<chahibi> gl, ah, I feel better now :)
Camarade_Tux has joined #ocaml
<gl> did someone use the (how is it called...:) c/ocaml bindings? i mean, i want to write to specific code in ocaml then call it from my main c program; i read some documentations about that but i don't get how painful it is to use in a big project
<kaustuv_> gl: the only real pain (and it's a big one) is that there can be only one instance of the ocaml runtime because it is full of crazy global variables
<kaustuv_> But there is a serious effort to fix that and make it reentrant soon-ish
<Alpounet> yeah
<Alpounet> that's recent
<gl> mmmmh
<Alpounet> let's see if work'll be done.
<Alpounet> Smerdyakov, what's your paper ?
<gl> i see, thank you kaustuv
komar_ has quit [Remote closed the connection]
seafood has quit []
<Alpounet> Looks like interesting, cheers.
chahibi has quit ["Quitte"]
<Alpounet> Smerdyakov, is that somehow part of Lambda Tamer ?
<Alpounet> Since it looks related to it.
<Smerdyakov> Alpounet, no.
<Smerdyakov> Alpounet, but I'm still working on Lambda Tamer. I expect I'll have a verified Core ML compiler in a month or so.
<Smerdyakov> Alpounet, I just finished the main theorem of the closure conversion, which was trickier than you might think. :)
<Alpounet> Smerdyakov, will it be a serious compiler ? Can you tell more about it ?
<Smerdyakov> Alpounet, I think the performance will be within a reasonable constant factor of SML/NJ's, but it's not really meant for development use.
<Alpounet> Okay. That looks interesting, even if not meant for development use.
AxleLonghorn has joined #ocaml
Kerris7 has quit ["Don't even think about saying Candlejack or else you wi"]
jeanbon has quit ["Hop."]
Camarade_Tux has quit ["Leaving"]
Associat0r has joined #ocaml
kaustuv_ has quit ["30f0848a734e006ec4b9ad142dfe79f1"]
<palomer> Smerdyakov, verifying in coq or twelf?
<palomer> oh, Coq
<palomer> surprising you didn't pick twelf
<palomer> any reason for that?
<Smerdyakov> This task is waaaay more practical in Coq. It's hopeless without automation.
<Smerdyakov> A heroic effort might lead to a result, but the code would be so long and ugly.
bombshelter13_ has quit []
ulfdoz_ has joined #ocaml
dobrekone has joined #ocaml
xerxes has joined #ocaml
dobrekone has quit ["Leaving..."]
<Yoric[DT]> 'night
ulfdoz has quit [Read error: 110 (Connection timed out)]
ulfdoz_ is now known as ulfdoz
Yoric[DT] has quit ["Ex-Chat"]
rwmjones has quit ["Closed connection"]
_andre has quit ["Lost terminal"]
Ariens_Hyperion has quit []
jamii has quit [Read error: 110 (Connection timed out)]
<Alpounet> brb, reboot.
Alpounet has quit ["Quitte"]
Alpounet has joined #ocaml
alexyk has quit []
<palomer> where can I find more documentation on :expr :str_item :ctyp and friends (in camlp4) ?
<palomer> found it