mattam has quit [Read error: 60 (Operation timed out)]
humasect has quit [Read error: 104 (Connection reset by peer)]
humasect has joined #ocaml
Gueben has quit ["Leaving"]
humasect has quit [Read error: 104 (Connection reset by peer)]
humasect has joined #ocaml
<vincenz>
l
Greylensman has joined #ocaml
cjohnson has joined #ocaml
smimou has quit ["?"]
humasect_ has joined #ocaml
humasect has quit [Connection timed out]
humasect_ has quit [Read error: 54 (Connection reset by peer)]
humasect has joined #ocaml
humasect has quit [Client Quit]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
Sonarman has joined #ocaml
cjohnson has quit [Connection timed out]
cognominal has quit [Remote closed the connection]
cognominal has joined #ocaml
Greylensman has quit ["Leaving"]
cjohnson has joined #ocaml
monochrom has joined #ocaml
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
Godeke has joined #ocaml
tintin has joined #ocaml
fph has joined #ocaml
picard has joined #ocaml
<picard>
what is the difference between lists and arrays? are lists linked lists?
<mauke>
yes
mlh has quit [Client Quit]
picard has quit ["Leaving"]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
monochrom has quit ["me!"]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
Riastradh has left #ocaml []
Riastradh has joined #ocaml
<Riastradh>
...whoops, wrong command.
Sonarman has quit ["leaving"]
fph has left #ocaml []
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
zzorn has joined #ocaml
__DL__ has joined #ocaml
pango has quit [Remote closed the connection]
cjohnson has quit [Connection timed out]
cjohnson has joined #ocaml
zzorn is now known as zzorn_away
Smerdyakov has quit [Read error: 110 (Connection timed out)]
Submarine has joined #ocaml
cjohnson has quit [Read error: 104 (Connection reset by peer)]
vezenchio has joined #ocaml
__DL__ has quit [Read error: 60 (Operation timed out)]
__DL__ has joined #ocaml
mattam has joined #ocaml
solarwind has quit ["Lost terminal"]
solarwind has joined #ocaml
Herrchen has joined #ocaml
_DL_ has joined #ocaml
__DL__ has quit [Read error: 110 (Connection timed out)]
<nlv11757_>
does ocaml have a " undefined :: 'a " kind of thing?
<nlv11757_>
a dummy placeholder able to fit everywhere as long as it isn't used
<det>
Do you have an example of a use?
<det>
I asume you use double-colon in a Haskell type declaration way, not a construction of a list?
<nlv11757_>
type decl
<nlv11757_>
i am overriding a method but the first argument is not of interest, so when calling i want to pass a dummy value which can adhere to any type
<nlv11757_>
in haskell you have undefined
<nlv11757_>
which is of type forall a. a
<nlv11757_>
you see what i mean?
<det>
Doesnt type inference take care of that for you if you never use it or name it _ ?
<det>
fun a b = b + 1 Would inference the type 'a -> int -> int, Am I misunderstanding?
<det>
erm
<det>
let foo a b = b + 1
<nlv11757_>
hmm, let me give an example; method foo : Foo -> Int -> Int
<nlv11757_>
now i am overriding this definition of foo, BUT i am never going to pass something of type Foo....so i want a placeholder to give to the function
<nlv11757_>
so i want to do this nicely and pass something like undefined
<det>
Is this specific to Ocaml's OO, becuase I dont know much about it
<nlv11757_>
no
<det>
Can you give an example without the OO? :-)
<nlv11757_>
i want to use a function foo : Foo -> Int -> Int.....but the first argument is never going to be used....BUT i still need to pass it something
<nlv11757_>
i want to pass something that is of any type
<nlv11757_>
haskell provides 'undefined' so maybe ocaml provides similar stuff
<nlv11757_>
maybe an exception is of any type/
<det>
Oh
<det>
How about unit?
<det>
Why is the first argument never used? Maybe that well help me tell you what is most idiomatic
<nlv11757_>
unit is of type () right? so it doesnt just fit anywhere
<nlv11757_>
i need a polymorphic value; i.e. of any type
<nlv11757_>
i think i will just define it
<det>
Is that a complete statement?
<nlv11757_>
que?
<det>
what do you mean by "I think I will just define it" ?
<det>
I think you are applying Haskellisms to O'caml where they dont make sense
systems has joined #ocaml
<nlv11757_>
sure it makes sense, i need to pass a polymorphic dummy value to a function because that value will never be used. Normally i would define that function without that argument...but i cant since i am not able to decide upon the type of this function.
<nlv11757_>
this is totally unrelated to Haskell
<det>
Then why not define the function, it will be infered that the first argument is polymorphic (or specify the type yourself) and then pass it whatever suits your fancy? unit works
<nlv11757_>
i was trying to explain i *cant* define this function myself because the signature is fixed.
<Herrchen>
if the signature is fix, then the first parameter should be of some type 'a
<Herrchen>
if it is some fixed type foobar, you are doomed anyway
<det>
What is the type of the first paramater in the signature?
<Herrchen>
you could only write a wrapper
<Herrchen>
everytime you need something that isn't foobar
<nlv11757_>
ok here's the deal: i am reimplementing a method with the signature: "stmt -> unit -> stmtkind -> doc" BUT in my implementation the "stmt" argument is not used. soooo i want to pass a dummy value when i USE this method
<nlv11757_>
there are more of these kind of situations....so i want to pass a value that can adhere to any type
<det>
In hasell, if you pass a function "undefined" what happens if the function tries to use it?
<nlv11757_>
it fails....but thats the whole use of undefined....you never use it but just pass it to make the typesystem happy
<Herrchen>
such a value doesn't exist for O'Caml
<Herrchen>
redefine the signature
<Herrchen>
or deliver a dummy statement
<Herrchen>
you could invent the "undefined" statement for this purpose, which might make porting easier :)
<Herrchen>
but if you really never need the first argument, why not simply drop it?
karryall has joined #ocaml
<det>
I think he is saying he is overiding a method that does use the first argument with one that doesnt use it
<Herrchen>
ah ok
<nlv11757_>
that is exactly what i am saying...i am tied by an API
<nlv11757_>
but as i said before i will just define it myself, just wondering if Ocaml offered something standard like that
<nlv11757_>
thanx though
systems has quit [Read error: 104 (Connection reset by peer)]
_DL_ is now known as __DL__
<Herrchen>
re
yangsx has joined #ocaml
cognominal has quit [Read error: 60 (Operation timed out)]
yangsx has quit [Remote closed the connection]
<nlv11757_>
ok oo question here
<nlv11757_>
the type of my implementation of a method is more general than the type for that method given by the classdefinition....
<_fab>
i'm looking for a ocaml parser for the c language, i remember vaguely that there was such a thing but can't find it via google... does anyone have a link?
<nlv11757_>
cil has one
<_fab>
cil?
<nlv11757_>
CIL: C intermediate language by berkeley university
<nlv11757_>
maybe you can pull the frontend off
<_fab>
ah, ok. thank you!
<nlv11757_>
anyone able to help me?
cognominal has joined #ocaml
<Herrchen>
nlv11757_: adding signature contraints to force the more special form? this should be automatically handled by the type-inference system
<nlv11757_>
exactly, i would think so. So let me show what im doing so im totally sure it's nothing else
<nlv11757_>
let's say the signature is 'int -> int -> int'
<nlv11757_>
and im doing this: fun _ _ -> 1
<nlv11757_>
in a method of course
<Herrchen>
hmm this doesn't type-check!?
<karryall>
do this: fun (_ : int) (_ : int) -> 1 ;;
<nlv11757_>
already tried that
<nlv11757_>
The method pLineDirective has type 'a -> 'b -> 'c
<nlv11757_>
but is expected to have type ?forcefile:bool -> Cil.location -> Pretty.doc
<nlv11757_>
the only thing im doing is: 'method pLineDirective = fun _ _ -> nil'
<nlv11757_>
where nil : doc
<nlv11757_>
so either that ? means more than i realise or something else
<karryall>
? is an optional argument
<karryall>
and yes you need it
<nlv11757_>
is '?forcefile:bool' the same as 'forcefile:bool option'
<karryall>
almost
<nlv11757_>
ok but this couldnt be the case of the type error then?
<karryall>
or method pLineDirective : ?forcefile:bool -> Cil.location -> Pretty.doc = fun ?forcefile _ -> nil
<Herrchen>
shouldn't the type-interence system be able to calculate the type-signature for him reducing this to something like method pLineDirective ?forcefile _ = nil
<nlv11757_>
it works, thanx man
<nlv11757_>
so this was because of the ?, can you explain what it does?
<nlv11757_>
or should i google :P
<Herrchen>
reference manual would be a good start to read about the "?"
<karryall>
labeled and optional arguments are a pain in method types, I usually avoid them
<nlv11757_>
k, i dont need to know it either :) so im skipping it
<nlv11757_>
thanx
<nlv11757_>
pffff i always bloody forget those annoying self# parts
Msandin has joined #ocaml
CosmicRay has joined #ocaml
Msandin has quit [Read error: 54 (Connection reset by peer)]
smimou has joined #ocaml
tintin is now known as hobbit`
hobbit` is now known as tintin
Herrchen has quit ["bye"]
Smerdyakov has joined #ocaml
Lez has joined #ocaml
<karryall>
It can be used either with proprietary OpenGL implementations (SGI, Digital Unix, Solaris, Windows, MacOSX, ...), with XFree86 GLX extension, or with open-source Mesa. Preliminary tesselator support was added to 1.01, with the assistance of Jon Harrop. Glut support is new in 1.00, and was contributed by Isaac Trotts. Christophe Raffalli contributed new GlArray support. Erick Tryzelaar also contributed to this release. Here is the
<karryall>
README for the current version.
<karryall>
woops
<karryall>
cut and paste landed in the wrong window, sorry :)
Herrchen has joined #ocaml
m3ga has joined #ocaml
zzorn_away is now known as zzorn
m3ga has quit ["disappearing into the sunset"]
Lez has quit ["A+"]
Godeke has quit [Read error: 104 (Connection reset by peer)]
Skal has joined #ocaml
Gueben has joined #ocaml
karryall has quit ["tcho"]
Msandin has joined #ocaml
Skal has quit [Remote closed the connection]
__mattam__ has joined #ocaml
humasect has joined #ocaml
cognominal has quit [Read error: 60 (Operation timed out)]
Msandin has quit [Read error: 110 (Connection timed out)]
__mattam__ has quit [Client Quit]
_JusSx_ has joined #ocaml
Herrchen has quit ["bye"]
humasect has quit [Read error: 104 (Connection reset by peer)]
humasect has joined #ocaml
Snark has joined #ocaml
tea has quit ["using sirc version 2.211+KSIRC/1.3.10"]
pango has joined #ocaml
picard has joined #ocaml
<picard>
I am reading the O'Reilly book and I see things like let () = print_newline() a lot. What is the purpose of doing let ()
<mattam>
you can't just 'print_newline ()'
<picard>
why not?
<mattam>
hmm, you're right
<mattam>
i guess people never thought they could... i never saw other things than let smthg ... at top level
<picard>
mattam: ok, so there is no deep hidden reason for it?
<mattam>
i see none at least
<Gueben>
# print_newline();;
<Gueben>
- : unit = ()
<Gueben>
# let () = print_newline();;
<Gueben>
#
<picard>
Gueben: print_newline();; for me prints the new line then - : unit = ()
<Gueben>
yes, that's what i said
<picard>
Gueben: oh sorry
<Gueben>
oh ok, my newline disappeared
<Gueben>
:)
<picard>
learning OCaml sure is taking longer than I expected
<Gueben>
i'm learning it too
<mflux>
I would guess the let-thingy is because there is a goal of writing programs without explicitly terminating expressions with ;;
<mattam>
i meant top level in a file, ie, real code
<mflux>
and program like let a = 42 print_newline () will not compile (newlines are irrelevant)
<mattam>
good point
<mflux>
let a = 42 let _ = print_newline () will
<picard>
mflux: I have also seen in used a lot where it was not really needed and ; would do the same thing... is that for a similar reason?
<mflux>
well.. I must admit my reason for using let _ = .. or let () = .. is because emacs' tuareg mode indentd code differently ;)
<mflux>
let's say I have let devices = retrieve_devices () in let () = reset_devices devices in let status = query_status devices in ..
<mflux>
so it doesn't have alternating let and non-let ;)
humasect has quit [Read error: 104 (Connection reset by peer)]
<picard>
mflux: so If I wanted to I could just use ; and put explicit ;; and this is only a style thing?
<mflux>
yes you could, but if you write the program so that it consists of functions you don't need to use ;; anyway
<picard>
great, thanks for the help
<mflux>
glad to be of help
monochrom has joined #ocaml
a-zwei has joined #ocaml
skylan_ has joined #ocaml
a-zwei has left #ocaml []
a-zwei has joined #ocaml
<a-zwei>
can anyone tell me if there's a way to find the memory usage of a data structure at runtime?
skylan has quit [Read error: 113 (No route to host)]
Snark has quit ["Leaving"]
mattam has quit ["zZz"]
vezenchio has quit ["I live in a yurt on the steppes of Sheepfuckistan. That's why."]
_JusSx_ has quit ["leaving"]
zzorn is now known as zzorn_sleep
__DL__ has quit ["Bye Bye"]
__DL__ has joined #ocaml
zzorn_sleep has quit ["They are coming to take me away, ha ha"]