kaustuv 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
<thelema_> anyone know how to do command-line #defines like gcc's -D?
<thelema_> I'm trying to read through optcomp to figure out how it does this
<thelema_> hmm, maybe -let x=y will do it.
slash_ has quit [Client Quit]
<thelema_> not in the ocamlc command-line... grr
<thelema_> now I have to figure out how to get ocamlbuild to put an option into the pp command, I think.
<thelema_> hmm, optcomp_o.byte doesn't take command-line options (other than the filename?) - so I can't pass it -let
<thelema_> and people wonder why I don't love camlp4
fishmacs has joined #ocaml
tmaedaZ is now known as tmaeda
BiDOrD has quit []
xevz has quit [Read error: 60 (Operation timed out)]
BiDOrD has joined #ocaml
xevz has joined #ocaml
BiDOrD has quit []
BiDOrD has joined #ocaml
Modius_ has joined #ocaml
Modius has quit [Read error: 110 (Connection timed out)]
fishmacs has quit [Read error: 54 (Connection reset by peer)]
julm has quit ["runaway !"]
rwmjones has quit [Remote closed the connection]
rwmjones__ is now known as rwmjones
damg has joined #ocaml
damg has quit [Client Quit]
tmaeda is now known as tmaedaZ
tmaedaZ is now known as tmaeda
rbancroft has quit [wolfe.freenode.net irc.freenode.net]
th1_ has quit [wolfe.freenode.net irc.freenode.net]
munga has quit [wolfe.freenode.net irc.freenode.net]
Proteus_ has quit [wolfe.freenode.net irc.freenode.net]
LeCamarade|Away has quit [wolfe.freenode.net irc.freenode.net]
rbancroft has joined #ocaml
th1_ has joined #ocaml
munga has joined #ocaml
LeCamarade|Away has joined #ocaml
Proteus_ has joined #ocaml
rbancroft has quit [Success]
rbancroft has joined #ocaml
^authentic has quit [wolfe.freenode.net irc.freenode.net]
mattam has quit [wolfe.freenode.net irc.freenode.net]
Demitar has quit [wolfe.freenode.net irc.freenode.net]
lutter has quit [wolfe.freenode.net irc.freenode.net]
bjorkLinux has quit [wolfe.freenode.net irc.freenode.net]
maxote has quit [wolfe.freenode.net irc.freenode.net]
tsuyoshi has quit [wolfe.freenode.net irc.freenode.net]
sgnb has quit [wolfe.freenode.net irc.freenode.net]
mattam has joined #ocaml
authentic has joined #ocaml
tsuyoshi has joined #ocaml
bjorkLinux has joined #ocaml
Demitar has joined #ocaml
lutter has joined #ocaml
sgnb has joined #ocaml
maxote has joined #ocaml
Cromulent has joined #ocaml
hkBst has joined #ocaml
Cromulent has quit []
bacam has joined #ocaml
BiDOrD has quit [Read error: 60 (Operation timed out)]
BiDOrD has joined #ocaml
eyda|mon has joined #ocaml
LeCamarade|Away is now known as LeCamarade
tmaeda is now known as tmaedaZ
Anarchos has joined #ocaml
acatout has quit [Read error: 110 (Connection timed out)]
acatout has joined #ocaml
yurug has joined #ocaml
onigiri has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
Spiwack has joined #ocaml
Beelsebob has quit ["Leaving."]
acatout has quit [Read error: 110 (Connection timed out)]
_andre has joined #ocaml
acatout has joined #ocaml
philed has joined #ocaml
onigiri has quit [Read error: 60 (Operation timed out)]
jimmyb2187 has left #ocaml []
onigiri has joined #ocaml
bombshelter13_ has joined #ocaml
Anarchos has quit ["Vision[0.9.7-H-090423]: i've been blurred!"]
Beelsebob has joined #ocaml
jimmyb2187 has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
bzzbzz has joined #ocaml
Cromulent has joined #ocaml
Ched has joined #ocaml
ski_ has joined #ocaml
ski_ has quit [Remote closed the connection]
Anarchos has joined #ocaml
thelema_ has quit [Read error: 110 (Connection timed out)]
LeCamarade is now known as LeCamarade|Away
Anarchos has quit [Read error: 54 (Connection reset by peer)]
brendan has quit [Read error: 113 (No route to host)]
<eyda|mon> If I have stuff.ml as a module, is there anyway I can call Stuff.func(); from another ml as an Ocaml script? How?
<yurug> eyda|mon: Look at ocamlmktop
<eyda|mon> hm, -help didn't give me any clue. I'll show in a pastie what I'm trying to do.
<eyda|mon> that's essentially what I expected to be able to do
<eyda|mon> well, more or less. I guess Sys.getcwd should have ()
<_andre> you could do this, i guess... http://pastie.org/587403
sramsay has joined #ocaml
<thelema> once you #use a file, its contents are brought right in. no module name. If you put a module in that file, you get the module.
<thelema> why do you want to use ocaml like this? why not compile?
rwmjones_ has joined #ocaml
onigiri has quit [Client Quit]
andre___ has joined #ocaml
Cromulent has quit []
ulfdoz has joined #ocaml
<eyda|mon> thelema: I come from an interpreted background. For me to transition into its use, it will be easier for me to do it this way. A big attraction for me with ocaml in general is its ability te interpreted, native compiled, and byte compiled
<eyda|mon> _andre: thank you :)
Spiwack has quit ["Leaving"]
<eyda|mon> how come I can't use Sys.getcwd as an argument to print_endline? after all, it does return a string
<thelema> print_endline (Sys.getcwd ())
<thelema> Sys.getcwd is a function, you could pass it as an argument, but not to print_endline.
_andre has quit [Read error: 110 (Connection timed out)]
andre___ is now known as _andre
<eyda|mon> yes, I had that syntax figured out, but if Sys.getcwd() returns a string, and print_endline takes a string, why can't I write print_endline Sys.getcwd() when I can write print_endline "/blah" ?
<thelema> because [print_endline Sys.getcwd ()] gives print_endline 2 arguments
<eyda|mon> what are the two arguments it gives? unit and string?
<thelema> Sys.getcwd and ()
<eyda|mon> so Sys.getcwd requires an argument?
<thelema> yes.
<thelema> f g x != f (g x)
<eyda|mon> oic. is there any function which does not take an argument?
<thelema> we call functions that don't take any arguments "values"
<thelema> functions are [x -> y], values are [y]
<eyda|mon> and to declare a value? it would be let a = 3 ?
<thelema> yup.
<eyda|mon> hm, that fills in a big piece of the puzzle
<eyda|mon> thanks much :)
<thelema> you're welcome. It's good to have someone teach this - it's mighty hard to learn on your own.
<eyda|mon> I appriciate the time you've taken to help me out btw.
<eyda|mon> agreed. things like this make me wish I had studied CS at school
<eyda|mon> but since I didn't, and now work in software, I feel like languages like these are important to understand.
<_andre> eyda|mon: you asked about a glob function yesterday, didn't you?
<thelema> CS wouldn't help you too much with this. a math background might.
<eyda|mon> _andre: that's true
<eyda|mon> no, I hadn
<eyda|mon> t seen that. thank you :)
<_andre> :)
<thelema> btw, I'm working on AAA batteries - smaller, lighter batteries.
<eyda|mon> What about CR123A ? My favorite atm :)
<eyda|mon> unlike AAA, they can be made to be Lithium Ion rechargables
<_andre> is something like [let rec until p f x = if p x then x else until p f (f x)] a good candidate for batteries?
<thelema> CR123A doesn't quite have the ring of AAA.
<eyda|mon> hehe, true
<thelema> andre: it could be - can you find a spot for it in our module heirarchy?
<_andre> would it be too radical to put it in Standard? :)
<thelema> I'm thinking somewhere in Control, but there really isn't a place for it there.
<_andre> it's defined in haskell's prelude, fwiw
sramsay has quit [Remote closed the connection]
<thelema> Looking through Standard, I can see a place for it with curry/uncurry/etc.
<thelema> hopefully we don't step on people's toes with this identifier
<thelema> can you give an example of using it?
Submarine has joined #ocaml
<_andre> well, i always use that in my code
<_andre> for example, i have a graph library that has a function that finds the strongly connected components
<_andre> and there's a part that reads "until stack_is_empty find_components comps"
<thelema> a simple example, for for documentation purposes.
<thelema> you don't need to convince me it's useful. You just need to show someone how to use it.
<_andre> ah, ok
<_andre> lemme come up with something
onigiri has joined #ocaml
<_andre> sorry work called...
<_andre> thelema: is this ok? http://pastie.org/587558
<thelema> that seems like a good candidate for a while loop, but it'll do.
<_andre> well, the idea is to get rid of while loops
<_andre> maybe an example with a counter would be better?
<_andre> to show how it can avoid references
<thelema> yes, an example where p actually examines x might be better.
<thelema> and while loops aren't bad - often they're just the right way to write something. and they're plenty efficient.
<_andre> how about this example from the ocaml tutorial?
<thelema> tricky things can be done with identifier naming. I'd normally call [quit] [identity]
<thelema> that's good enough. Thanks.
<thelema> if you come up with something else, put it in the batteries bug tracker
<_andre> ok :)
<kaustuv> I think that until invocation is unreadable. Not quite as unreadable as the average fold, but pretty up there.
<thelema> kaustuv: got a better example?
<_andre> well the function names could be changed...
<_andre> ignore (until user_decided_to_quit read_user_input false)
<kaustuv> let ask () =
<kaustuv> print_string "Have you had enough yet? (y/n) ";
<kaustuv> let str = read_line () in str.[0] <> 'y'
<kaustuv> in while ask () do () done ;;
slash_ has joined #ocaml
_andre has quit ["leaving"]
Camarade_Tux has joined #ocaml
MichaelGG has joined #ocaml
Narrenschiff has joined #ocaml
jimmyb2187 has left #ocaml []
Anarchos has joined #ocaml
bzzbzz has quit ["leaving"]
ulfdoz has quit [Read error: 110 (Connection timed out)]
thelema_ has joined #ocaml
Ched has quit ["Ex-Chat"]
Anarchos has quit ["Vision[0.9.7-H-090423]: i've been blurred!"]
Narrenschiff has quit []
MichaelGG has quit ["Leaving"]
bombshelter13_ has quit [Client Quit]
yurug has quit ["KVIrc Insomnia 4.0.0, revision: , sources date: 20090115, built on: 2009/03/07 00:45:02 UTC http://www.kvirc.net/"]
Cromulent has joined #ocaml
<Camarade_Tux> w :)
<Camarade_Tux> about godi's slowness, godi_console is bytecode, even on i386 or x86_64 (compiled with -custom, that's why 'file' doesn't say it's bytecode)
<Camarade_Tux> a native code version runs about twice as fast
<Camarade_Tux> (actually up to thrice)
jeddhaberstro has joined #ocaml
onigiri has quit [Client Quit]
onigiri has joined #ocaml
onigiri has quit [Client Quit]
sgnb has quit [Read error: 104 (Connection reset by peer)]
sgnb has joined #ocaml
Demitar has quit ["Ex-Chat"]
lanaer has quit [Read error: 113 (No route to host)]
Cromulent has quit []
thrasibule has joined #ocaml
lanaer has joined #ocaml
Cromulent has joined #ocaml
<hcarty> Camarade_Tux: Interesting find. Is it difficult to build a native code version of godi_console?
<Camarade_Tux> hcarty: no, not at all, if you have godi, you can get one of the .tar.gz/.tgz (I'll find the good one in a second), extract it, cd, and make opt, that simple
<hcarty> Camarade_Tux: Very nice, thanks.
<Camarade_Tux> hcarty: here, I have /ocaml/build/godi/godi-tools/work/godi-tools-2.0.10/console-src , go there and 'make opt', it will produce console/godi_console.opt
<Camarade_Tux> time to go to bed now, good night :)
<hcarty> Camarade_Tux: Thanks again! Looks like it works here.
<Camarade_Tux> :)
<hcarty> Good night
<hcarty> Wow... that really is faster.
<Camarade_Tux> it's probably pretty easy to change (I'd done that but I didn't have godi sources ='( )
<Camarade_Tux> hcarty: hehe :P
* Camarade_Tux disappears
mbishop_ has joined #ocaml
mbishop has quit [Read error: 113 (No route to host)]
mbishop_ has quit [Read error: 110 (Connection timed out)]
mbishop_ has joined #ocaml
Cromulent has quit []