crabstick has quit [Read error: 110 (Connection timed out)]
crabstick has joined #ocaml
seafoodX has joined #ocaml
crabstick_ has quit [Read error: 110 (Connection timed out)]
buluca has quit [Read error: 113 (No route to host)]
<tsuyoshi>
don't worry too much about it.. the first thing I realized after I finally understood functors was that they weren't terribly useful
<Smerdyakov>
Luckily, you're wrong! :D
ednarofi has joined #ocaml
Zzompp has joined #ocaml
seafoodX has quit []
CRathman has joined #ocaml
authentic has quit [Remote closed the connection]
authentic has joined #ocaml
Smerdyakov has quit ["Leaving"]
abez has quit ["ugh"]
CRathman has quit [Read error: 110 (Connection timed out)]
ednarofi has quit [Read error: 104 (Connection reset by peer)]
bluestorm_ has joined #ocaml
ednarofi has joined #ocaml
seafoodX has joined #ocaml
seafoodX has quit [Read error: 104 (Connection reset by peer)]
seafoodX has joined #ocaml
smimou has joined #ocaml
pattern has quit [heinlein.freenode.net irc.freenode.net]
pattern has joined #ocaml
<danderson>
after a night's sleep, and applying an analogy from the C++ world
<danderson>
it looks like functors are somewhat like template classes, with concepts (type-checking for the template parameters, due in the next c++ standard)
<danderson>
and generally on crack, thanks to currying
slipstream-- has joined #ocaml
<smimou>
danderson: that's right
pattern has quit [heinlein.freenode.net irc.freenode.net]
ygrek has joined #ocaml
pattern has joined #ocaml
slipstream has quit [Read error: 113 (No route to host)]
buluca has joined #ocaml
ktne has joined #ocaml
<ktne>
hello
<ktne>
anyone here using f#?
<ktne>
be aware that i'm a newbie :)
<ktne>
oh, found the error, undefined variable :)
<ktne>
the f# compiler errors aren't too helpful :)_
<bluestorm_>
if you're a newbie, F# errors are likely to be understandable by OCaml users
<ktne>
i've got a syntax error pointed at a :>
<bluestorm_>
could you show the code ?
<bluestorm_>
(unless :> is different from the OCaml one, that does not look like a "newbie" use)
<ktne>
the variable before :> isn't declared, but why does it point to syntax error?
<ktne>
instead of something like "missing declaration"
<ktne>
anyway i've found the problem :)
<ktne>
i thought it's function composition
<ktne>
i try to do a pipeline processing
<ktne>
but thanks anyway, it was that i forgot to define a small function
lde` is now known as lde
G_ has joined #ocaml
Tetsuo has joined #ocaml
G has quit [Success]
Cygaal has joined #ocaml
G has joined #ocaml
lde has quit [Read error: 113 (No route to host)]
lde has joined #ocaml
G_ has quit [Connection timed out]
seafoodX has quit []
smimou has quit ["bli"]
puks has joined #ocaml
G_ has joined #ocaml
G has quit [Read error: 110 (Connection timed out)]
kelaouch1 has quit ["leaving"]
ednarofi has quit [Read error: 104 (Connection reset by peer)]
ednarofi has joined #ocaml
Cygaal has quit []
kelaouchi has joined #ocaml
G has joined #ocaml
G_ has quit [Connection timed out]
ednarofi_ has joined #ocaml
ednarofi has quit [Read error: 104 (Connection reset by peer)]
mr_hugo has joined #ocaml
<mr_hugo>
hello
<mr_hugo>
how do i read the parameters passed in the shell with my program in ocaml ? (like argc and argv in C)
<flux>
Sys.argv is an array that has them
<flux>
man Sys for reference on what else it has
<fremo>
or the Arg module...
<mr_hugo>
sweet
<flux>
yeah, Arg is terrific for handling command line arguments
<mr_hugo>
i didn't knew the man pages worked with OCaml, thats very nice
<flux>
shame its interface isn't functional
<fremo>
heh ! :)
<mr_hugo>
hehehe
<fremo>
flux: yes...
<ktne>
anyone here using f#?
<ktne>
what is the preffered way of dealing with binary I/O in f#?
<flux>
isn't there a channel for f#? (I'm not saying you can't ask that here, just wondering)
<ktne>
no
ednarofi_ has quit [Read error: 110 (Connection timed out)]
Demitar has quit [No route to host]
Flynsarmy has joined #ocaml
<Flynsarmy>
What is OCaml best used for?
<ktne>
implementing complicated algorithms
<rwmjones>
as a replacement for where you might use C++ to write applications
<ktne>
especially ones that deal with a lot of symbolic information (like compilers, parsers, etc)
<ktne>
but yes it's general purpose
<Flynsarmy>
Cool. We're doing an assignment on it and i checked out the website but it didn't say anywhere what it was best used for. Just kept going on about how it had 2 compilers
<Flynsarmy>
No. It's just a few questions about Python Ocaml and Eiffel
<bluestorm_>
i'm just curious : what kind of school is that ?
<mr_hugo>
the _ function is the OCaml entrypoint ?
<Flynsarmy>
It's a university in Australia
<rwmjones>
mr_hugo, no
<mr_hugo>
hmm :/
<rwmjones>
mr_hugo, everything at top level is evaluated in order
<rwmjones>
mr_hugo, the only things which are not evaluated are function definitions
<mr_hugo>
hmm ok
<bluestorm_>
and _ isn't a function
<bluestorm_>
it's a pattern
<mr_hugo>
so in the end i just call the entrypoint that i want...
<bluestorm_>
(that matches everything)
<bluestorm_>
hm
<ktne>
mr_hugo there is no entrypoint
<ktne>
mr_hugo the code is just executed top to bottom
<mr_hugo>
ok
<mr_hugo>
what is the order of .ml files it executes ?
<ktne>
what do you mean?
<bluestorm_>
you choose it a linking time
<bluestorm_>
+t
<mr_hugo>
ok
<bluestorm_>
and that's important for module dependencies : you can't just put files in alphabetical order
<mr_hugo>
ok
<bluestorm_>
(wich is why simple Makefiles aren't that useful for ocaml)
<mr_hugo>
yes i see
<danderson>
I have to say, so far, although I find ocaml very cool, I don't yet see how to write stuff in it. That's probably my imperative background resisting :)
<mr_hugo>
is there any example of a simple compiler on the net that i can read the code ?
<mr_hugo>
a simple parser i mean
<bluestorm_>
parser for what ?
rwmjones has left #ocaml []
<mr_hugo>
a computer language
<mr_hugo>
C for instance
<bluestorm_>
danderson: exercice yourself !
<bluestorm_>
hm
<danderson>
dunno about simple, but LiquidSoap (savonet.sf.net) is a radio streaming application in ocaml
<danderson>
and the configuration is a scripting language
<mr_hugo>
i would like to see how to define parsing tree's
<mr_hugo>
ah good
<danderson>
where 'sources' are first order types, that you assemble to build a pipeline
<danderson>
dunno how easy it is to understand though, it's no small app.
<flux>
mr_hugo, actually I think the documentation has an example of a simple parser for a calculator
<ktne>
i'm working on a small xml parser right now :)
<ktne>
i'm using the composition operator in order to compose EBNF rules :)
<ktne>
each EBNF rule is a function, each function is a composition of several other rules :)
<mr_hugo>
i saved it into a file "test.ml" and run ocaml test.ml test1 test2 test3
<mr_hugo>
but it displays a line 3, characters 0-3:Syntax error
<mr_hugo>
:/
<flux>
put ;; after open
<mr_hugo>
ah ok
<flux>
however you can write ;;less code if you put everything into definitions
leo037 has joined #ocaml
<flux>
like: let _ = for ..
<mr_hugo>
wierd ;; definition :/
<mr_hugo>
why isn't ;; needed at the end of the for loop ?
tty56 has quit [Read error: 60 (Operation timed out)]
<flux>
I think it goes like: a section can either contain definitions or an expression
<flux>
and ;; separate sections
<mr_hugo>
ohh nice
<mr_hugo>
yes, that makes it simple
<mr_hugo>
i was trying to memorize where to put the strange ;;
<xavierbot>
Characters 1-2:
<mr_hugo>
heheh
<xavierbot>
i was trying to memorize where to put the strange ;;
<xavierbot>
^
<xavierbot>
Unbound value i
<xavierbot>
Characters 14-16:
<xavierbot>
Parse error: illegal begin of top_phrase
<flux>
:)
<Flynsarmy>
ocaml is a higher level language than python?
<mr_hugo>
ahaha very cool
<flux>
flynsarmy, I think they are pretty much the same level
<flux>
a higher level language would be something fully declarative, such as prolog
<Flynsarmy>
yea that's what i'd been reading. Ocaml/Python/Eiffel are all high level languages. Kind of makes it difficult to answer the question :S
<danderson>
Flynsarmy: I would say that ocaml is somewhat higher, since python lacks a few functional tools
<mr_hugo>
i would like a "inline C" feature to ocaml :)
<mr_hugo>
__C__
<flux>
mr_hugo, hey, you could do that with camlp4 :)
<flux>
hm, infact that'd be great for writing ocaml/c-wrappers..
<fremo>
heh, yes :)
<mr_hugo>
oh i see
<flux>
mr_hugo, if you're attempting to interface with a c-library, don't miss ocamlidl
<flux>
or swig (but I haven't used swig)
<flux>
but swig documentation looked great for c++: it even adds a language extension so that you can user object->method -kind of syntax in ocaml, for c++ objects
cpst has quit []
<bluestorm_>
flux: altought introspection features of Python could be considered as a "high level" feature
CRathman has joined #ocaml
<flux>
hmph.. this is getting old, writing almost-the-same sql queries over and over, wish there was a good statically typed dynamic sql query generator library for ocaml
<flux>
(my own hack doesn't even pass my own tests, plus it doesn't cover everything I can do directly)
<flux>
((of course, composability would be a requirement for such a generator))
CRathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
easports has joined #ocaml
Flynsarmy has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
piggybox has quit [Connection timed out]
ygrek has quit [Remote closed the connection]
authentic has joined #ocaml
slipstream-- has quit [Remote closed the connection]
slipstream has joined #ocaml
smimou has joined #ocaml
slipstream-- has joined #ocaml
piggybox has joined #ocaml
crathman has joined #ocaml
seafoodX has joined #ocaml
piggybox_ has joined #ocaml
slipstream has quit [Connection timed out]
seafoodX has quit []
ednarofi has quit [Read error: 110 (Connection timed out)]
piggybox__ has joined #ocaml
piggybox has quit [Connection timed out]
piggybox_ has quit [Read error: 110 (Connection timed out)]
piggybox_ has joined #ocaml
ednarofi has joined #ocaml
piggybox__ has quit [Read error: 110 (Connection timed out)]
pango has quit [Remote closed the connection]
pango has joined #ocaml
Mr_Awesome has quit ["aunt jemima is the devil!"]
crathman has quit ["ChatZilla 0.9.78.1 [Firefox 2.0.0.6/2007072518]"]
Smerdyakov has joined #ocaml
ygrek has joined #ocaml
mr_hugo has quit [Remote closed the connection]
CRathman has joined #ocaml
ygrek has quit [Remote closed the connection]
abez has joined #ocaml
G_ has joined #ocaml
ygrek has joined #ocaml
G has quit [Connection timed out]
buluca has quit [Connection timed out]
buluca has joined #ocaml
ednarofi has quit [Read error: 110 (Connection timed out)]
ednarofi has joined #ocaml
ktne has quit []
mr_hugo has joined #ocaml
mr_hugo has quit [Read error: 104 (Connection reset by peer)]
<hcarty>
flux: Have you ever received this error from camlidl: File /usr/include/bits/types.h, line 50, column 0: syntax error
<hcarty>
Or anyone else using camlidl, for that matter...
<hcarty>
The line in question starts __extension__ ... and defines a __int64_t typedef
scruffie has quit [Read error: 110 (Connection timed out)]
cpst has joined #ocaml
<flux>
I wouldn't try including system headers with camlidl
<flux>
it is not a c-compiler, it is its own language which just very much resembles C struct definitions
<flux>
so you probably still need to go through the header file
<hcarty>
Would you recommend just copying over any required #defines, etc, manually?
<flux>
with my very incomplete esd-bindings I used that approach
<hcarty>
Ok, thank you
<flux>
copied the original esd.h, commented everything out and then started basically copying stuff
<hcarty>
Do you know of a way to force an array to be an array of int32 values?
<Tetsuo>
use a bigarray
<flux>
I think there's a way but I don't remember offhand
<hcarty>
Tetsuo: Thanks, I'll give it a shot
<hcarty>
I don't know if this is the best way, but it can be set at the interface and/or individual function level with (long|int)_default(...)