<thelema>
jganetsk: it declares a type abbreviation that has to be coerced back to the regular type, and can only be constructed within the defining module.
alexyk has quit []
jganetsk has quit [Remote closed the connection]
seafood_ has joined #ocaml
adrian_2002ca has joined #ocaml
<adrian_2002ca>
hi all, how do I compute the integral to a math function(float->float) ?
<adrian_2002ca>
:'( im sooo lost now
nuncanada has quit ["Leaving"]
<adrian_2002ca>
help anyone
kaustuv has joined #ocaml
<adrian_2002ca>
heeeeelp
seafood has quit [Connection timed out]
<hcarty>
adrian_2002ca: If someone here has time and can help they will likely offer their assistance
<adrian_2002ca>
hcarty: kk, thanks!
adrian_2002ca has left #ocaml []
palomer has joined #ocaml
<palomer>
im reading the lablgtk source
<palomer>
and I can't find a default value for xpad
<palomer>
ahh, ? notation is strange
<palomer>
cool!
<thelema>
default values are fun.
<palomer>
wait
<palomer>
erm...
<palomer>
this poses a problem for me
<palomer>
you see...
<palomer>
I'm recycling widgets
<palomer>
so I need to reset them when I'm done with them
<palomer>
so I need the default value of xpad and friends
<palomer>
you reading me?
<palomer>
I'll just take a wild guess of... 0
<thelema>
the default value isn't right there?
<palomer>
right where?
<palomer>
im looking at gMisc.mli
<palomer>
gtkPack.ml has xpadding=0
<thelema>
yup, just found taht...
<palomer>
but I don't see how the 2 relate
<palomer>
how do those two files interact?
alexyk has joined #ocaml
<thelema>
hmmm...
<kaustuv>
any debian ocaml maintainers here?
<thelema>
palomer: assume it's 0.
<palomer>
but then there's ?spacing and ?homogeneous in vbox
Axioplase_ has quit ["Lost terminal"]
seafood has joined #ocaml
<palomer>
and then xalign
<palomer>
for labels
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
seafood_ has quit [Read error: 110 (Connection timed out)]
Axioplase has joined #ocaml
jeddhaberstro has joined #ocaml
<ski__>
palomer : you could hide the object inside an ADT represented as a `ref', and replace the object, when revoking
<ski__>
or, you could build that into a wrapper object like
<ski__>
# let make_revoker o = let r = ref o in (fun () -> r := object method b = raise Revoked method c = raise Revoked end),object method b = !r#b method c = !r#c end;;
<ski__>
val make_revoker : < b : 'a; c : 'b > -> (unit -> unit) * < b : 'a; c : 'b > = <fun>
<ski__>
# a;;
<ski__>
- : < b : int; c : int -> int > = <obj>
<ski__>
# let rev_a , r_a = make_revoker a;;
<ski__>
val rev_a : unit -> unit = <fun>
<ski__>
val r_a : < b : int; c : int -> int >
<ski__>
= <obj>
<ski__>
so `r_a' is a stand-in for `a', and `rev_a ()' revokes it
<ski__>
obviously though, it is a bit tedious to manually wrap all the methods in the `make_revoker'
<ski__>
(and there might potentially be other problems with this approach, too .. i haven't considered it that much, yet)
* ski__
leaves
alexyk has quit []
christian_ has joined #ocaml
<christian_>
Hi bots!!
<christian_>
!weather NY
wks has joined #ocaml
bzzbzz has quit ["leaving"]
alexyk has joined #ocaml
wks has left #ocaml []
willb has joined #ocaml
m3ga has joined #ocaml
palomer has quit [Remote closed the connection]
alexyk has quit []
alexyk has joined #ocaml
vuln has quit ["fuiz"]
jeddhaberstro has quit []
m3ga has quit ["disappearing into the sunset"]
alexyk has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
palomer has joined #ocaml
<palomer>
so... class foo = let bar = ref 0 in object(self)... end
<palomer>
bar is like a global variable in this case, right?
<palomer>
but its scope is limited
<ski__>
define "global"
<ski__>
(or, rather, please don't)
<ski__>
(it might be nicer to lift out the `object ..Revoked.. end' from the `fun () -> ..' .. or maybe even make sure the revoker only assign once .. but this is just optimization)
<christian_>
hi...which language should i learn ( first): ocaml or haskell?
* ski__
grows unsure of whether my earlier suggestion was seen by palomer
<ski__>
christian_ : depends on what you want
<ski__>
do you want to learn FP ?
<christian_>
well i want to write a multiagentsystem
<palomer>
ah yes
<christian_>
and yeah..FP of course
<palomer>
ski__, thanks for the earlier suggestion
<christian_>
But OO is also nice
<ski__>
it can be, yes
<palomer>
ski__, by global I mean that one variable is accessible by all instances
<palomer>
which seems to be the case
<ski__>
haskell has the advantage of (more or less) forcing you to learn FP methods, by not letting you get away with imperative patterns so easily
<christian_>
i see
<christian_>
So OO is overrated?
<ski__>
ocaml has the advantage of possibly moving slowly from imperative to FP methods, not taking the deep plunge
<christian_>
ok
<ski__>
some people prefer one, some the other
<palomer>
most people here probably prefer ocaml
<ski__>
also, there's other differences between haskell and ocaml, of course
<palomer>
most people in #haskell probably prefer haskell
<ski__>
palomer : unsurprisingly :)
<palomer>
:P
<christian_>
so i think
<christian_>
i heard haskell has a crappy module system
<ski__>
it has, indeed
<christian_>
or say: not so good as ocaml
<ski__>
(speaking as a haskeller myself, who's sometimes visiting ocaml)
<ski__>
yes, it's ok (unlike certain other languages)
<ski__>
but it's not great
<christian_>
i see
<ski__>
(`it' being haskell's module system)
<ski__>
though in the beginning, the advanced module systems isn't all that important
<christian_>
is ocaml a message based language as - eg erlang?
<palomer>
I don't use the ocaml module features all that much
<ski__>
and not always for larger applications, either
<palomer>
in fact, I don't use them at all
<ski__>
christian_ : no
<christian_>
Well, i want my code ready for future for the next 10 years
<christian_>
i want to study informatic in germany
<ski__>
palomer : instances of what ?
<christian_>
and i dont want such languages as c or c++ or java
<palomer>
ski__, of the class
<palomer>
christian_, those languages might be around longer than both ocaml and haskell
<ski__>
christian_ : yes, it'd say OO (which isn't even well-defined) is largely over-hyped
<ski__>
(s/it/i/)
<christian_>
i see
<palomer>
OO is great!
<christian_>
but there are too close to the machine
<ski__>
it can be, yes
<ski__>
but insisting on OO methods in all cases is not great
<palomer>
like anything
<christian_>
i want a language which is possibly ready for quantum computers
<ski__>
(yes)
<christian_>
i think c is out of date then
<ski__>
then i'd say one of the best bets is keeping track of FPs
<christian_>
so i thought
<christian_>
:)
<ski__>
many later features in many languages have originated in FPs .. and in some cases trickled down to imperative languages