lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
Kinners has joined #ocaml
palomer has quit [Remote closed the connection]
ionOS has quit ["Lost terminal"]
lament has joined #ocaml
palomer has joined #ocaml
<palomer>
what's the # operator do?
<whee>
it's for method calls, I think
lament_ has joined #ocaml
lament_ has left #ocaml []
<palomer>
is it possible to delay the binding of a variable? more specically, can I put a default argument to a function and only have that argument evaluated in the closure in which it is called?
<palomer>
what's the difference between an initializer and a constructor?
<palomer>
:o/
palomer has quit [Remote closed the connection]
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
<pattern_>
"This expression has type 'a list but is here used with type 'a"
<pattern_>
why does it expect an 'a instead of an 'a list?
<pattern_>
ahh... i think i know...
<pattern_>
the :: operator expects single elements, not lists
<pattern_>
for lists i have to use the @ operator
Kinners has quit [Read error: 104 (Connection reset by peer)]
palomer has joined #ocaml
<palomer>
:o
<palomer>
anyone know what the ~ operator does?
mattam has quit [Read error: 110 (Connection timed out)]
mattam has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8 has joined #ocaml
phubuh has joined #ocaml
phubuh has quit []
systems has joined #ocaml
systems has quit [Client Quit]
TachYon26 has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
mellum has joined #ocaml
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
<pattern_>
my code compiles and runs fine with ocamlp4o and ocamlc, but when i run it through ocamldep it generates syntax errors in weird places
<pattern_>
why would there be such a discrepancy? is ocamldep buggy or out of date?
pk5 has joined #ocaml
<pattern_>
let foo =
<pattern_>
try
<pattern_>
print_newline ()
<pattern_>
with
<pattern_>
Unix.Unix_error Unix.ENOENT x y -> exit 1
<pattern_>
that's a piece of code that goes through ocamlc and ocamlp4 fine... but ocamldep gives me a syntax error on the last line, on the "y"
<pattern_>
if i take out the "y" ocamldep lets it through
<pattern_>
ocamldep also gives me a syntax error on an assert in my real program, but i can't seem to reproduce it in a sample program to show here
<pattern_>
but, again, my original program compiles and runs fine with ocamlc and ocamlp4... so these discrepancies lead me to believe ocamldep is buggy
systems has joined #ocaml
systems has left #ocaml []
<smkl>
try ocamldep -pp camlp4o or something
<pattern_>
good job!
<pattern_>
:)
<pattern_>
the docs don't even list a -pp option for ocamldep
<pattern_>
nor for ocamlc, for that matter
<pattern_>
i mean the man pages, not the docs... the docs may well have more to say
<pattern_>
so why do you think the code needs to be preprocessed for ocamldep?
<pattern_>
is what i'm writing somehow nonstandard?
<mrvn>
-pp changes the parser afaik. So if you use -pp on ocamlc but not on ocamldep they can (but should not) behave differently.
<mattam>
constructors with multiple argument can't be matched with Const x y in standard ocaml
<mrvn>
but Const(x, y), right?
YveDeLarc has joined #ocaml
<YveDeLarc>
hi
<mattam>
yep
pk5 has quit ["ERC vVersion 3.0 $Revision: 1.328 $ (IRC client for Emacs)"]
<pattern_>
i see... thanks mrvn and mattam
TachYon26 has joined #ocaml
polin8 has quit [Read error: 104 (Connection reset by peer)]
polin8 has joined #ocaml
<palomer>
:o
polin8 has quit [Read error: 110 (Connection timed out)]
<palomer>
:oo
pk5 has joined #ocaml
<palomer>
is there an ~ operator?
<smkl>
palomer: no
<smkl>
~ is used for labeled arguments
<palomer>
eh?
<YveDeLarc>
like in put ~what:`tea ~where:`cup ~why:[`user_thirsty,`tea_is_good]
<YveDeLarc>
s/,/;/
<YveDeLarc>
sri
Rapiere has joined #ocaml
TachYon26 has quit [Remote closed the connection]
docelic|away is now known as docelic
polin8_ has joined #ocaml
TachYon26 has joined #ocaml
<palomer>
ahh
<palomer>
I see
<palomer>
what does let main() = .. do?
<whee>
palomer: nothing, just creates a function called main
<palomer>
why the () ?
<whee>
it wouldn't be a function if it didn't accept some argument
<whee>
there should be a space after main, to make it clear that () is an argument
<palomer>
let main = fun -> dostuff ?
<whee>
indeedy
<palomer>
so let main () = dostuff is the same as let main = fun -> dostuff?
<whee>
well it's a function that deals with a unit argument there
<whee>
like any other function
<whee>
there's no convention that main must be defined and used in ocaml
<palomer>
so are they equivalent?
<whee>
let main = fun () -> bloop
<palomer>
ahh, I see
<palomer>
btw anyone have that lablgtk tutorial?
<palomer>
the website is down and google cache/wayback machine don't have it
<palomer>
and I cant find it on any other website
<palomer>
oh, and is it possible to have default arguments, and if so can you do it so that it binds the default in the closure in which the function is called?
<whee>
you can do labeled arguments with default values
<whee>
don't know what you mean by the last part
<palomer>
say function foo takes parameter a
<palomer>
that has a default value of b
<palomer>
I want b to be evaluated in the context in which the function is called
<whee>
er, I don't know how easy that would be
<palomer>
guessing kinda hard eh
<palomer>
I mean, what if b isn't bound in the context
<palomer>
:o
<whee>
I don't think ocaml has facilities for that
<whee>
ghc (haskell) does :)
<palomer>
really?
<palomer>
I that would be quite imperative
<whee>
no, not really
<palomer>
doesn't functional programming want us to bind the variable as soon as possible
<whee>
not that I know of
<whee>
heh
<palomer>
for example let a = 4 ;; let b c = a;;
<whee>
you just have to bind before you use it
<palomer>
btw is there a difference between message passing and calling a method?
<palomer>
or are they synonymes?
<whee>
well, yes they're different
<whee>
when I think of message passing I think of something more dynamic and done at runtime
<whee>
but I guess they achieve the same effect
polin8_ has quit [Read error: 110 (Connection timed out)]
<palomer>
so when I do foo#bar#foobar
<palomer>
first I pass bar to foo
<palomer>
then I take the resulting method and pass foobar
<palomer>
erm, no wait
<palomer>
foo#bar#foobar#barfoo
<palomer>
I pess foobar to bar, and barfoo to the result
<palomer>
correct?
<whee>
I guess :)
<whee>
I never use the OO part, heh
<mattam>
it's called method chaining palomer
<palomer>
like C++'s and java's cascading?
<mattam>
yes
<palomer>
gotcha
<palomer>
any features that are ocaml specific?
<whee>
they don't suck? :)
<mattam>
features of the OO part ?
ionOS has joined #ocaml
<YveDeLarc>
hmm. is there anything like 'eval'?
<smkl>
YveDeLarc: you can use the toplevel library to do something like that
<YveDeLarc>
hmm. Is it part of the standard distribution?
<YveDeLarc>
I can't find it in the documentation and Google does not return anything useful with the query 'ocaml toplevel library'. Could you give me a pointer?
<smkl>
well, it only works in bytecode
<smkl>
i could give you something useful but caml mailing list search isn't working
<YveDeLarc>
found sth interesting on Caml Hump: Dynamic Caml, which has eval for a subset of OCaml - http://oops.tepkom.ru/dml/
<smkl>
try: let eval x = Toploop.execute_phrase true Format.std_formatter (!Toploop.parse_toplevel_phrase (Lexing.from_string (x^";;")))
<YveDeLarc>
works. wow. thank you very much. :)
polin8 has joined #ocaml
mrvn_ has joined #ocaml
mrvn has quit [Read error: 60 (Operation timed out)]
icefox has joined #ocaml
<icefox>
Anyone alive?
<mellum>
yes
<icefox>
Wonderful. You have any experience with lablgl?
<mellum>
Not really
<icefox>
Oh well. Thanx anyway.
<icefox>
Anyway... Dun suppose you can tell me what to do if it says it's missing a DLL but doesn't tell me which one?
lament has joined #ocaml
icefox has quit [Read error: 104 (Connection reset by peer)]
Rapiere has left #ocaml []
mattam_ has joined #ocaml
mrvn_ is now known as mrvn
mattam has quit [Read error: 110 (Connection timed out)]
TachYon26 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
<palomer>
can anyone connect to the lablgtk website?
<YveDeLarc>
yes. but for some reason library was not accessed.
<YveDeLarc>
i got it to work with -custom and -cclib -lbigarray
<YveDeLarc>
*sigh* didn't really work.
<palomer>
:o
<palomer>
man im bored and my team is late so I can't start and lablgtk website is down so I can't learn and I know that next week I'll be swamped with work:/
<YveDeLarc>
palomer: you may try downloading from other sources (e.g. debian)