<Smerdyakov>
mutable and ref together is a little silly.
<Smerdyakov>
Oh, and this brings up an important difference between ref's and pointers:
<Smerdyakov>
ref's can't be null. Pointers can.
<ita>
refs can't be null, i see
<drWorm>
you can have refs to an Option value, no? :)
<Smerdyakov>
But this is not a problem, thanks to OCaml "let rec" fancyness.
<ita>
i wonder how to reference some sort of Empty thing
<Smerdyakov>
ita, why bother when you can reference the object itself?
<ita>
errm yep good idea
<Smerdyakov>
The toplevel spams your screen when you evaluate an expression to a circular data structure. :D
<ita>
is that possible to do that without using let rec ?
<ita>
(a bit concerned about speed issues)
<Smerdyakov>
I don't think so. You have to either use let rec, option ref's, etc..
<Smerdyakov>
(The latter changes the type of the structure.)
<Smerdyakov>
What speed issues are you concerned about?
<ita>
i've ported an algorithm from c to ocaml and it runs slower - i'm trying to improve it now but i need a doubly linked list
<Smerdyakov>
Whatdoes that have to do with let rec?
<ita>
oh yes the let rec .. it just sounds "not clear" for me :)
<Smerdyakov>
What do you mean?
<Smerdyakov>
You mean you don't know how to use it to set up a self-pointing record value?
<ita>
yes, that's it
<Smerdyakov>
type a = {b : a};;
<Smerdyakov>
let rec c = {b = c};;
<ita>
ok
<ita>
thanks
Iorek has joined #ocaml
<Iorek>
what do you people think about a ocaml plugin for eclipse ? would anyone want to use it ?
<ita>
me
<ita>
i would
<ita>
though i mostly use kdevelop
<drWorm>
Iorek: i would
<drWorm>
i use emacs, the ocaml mode is pretty good
<Iorek>
I use emacs too
<drWorm>
but eclipse has pretty good emacs key emulation :)
<Iorek>
and the ocaml mode is indeed good...
<Iorek>
drWorm: yep :)
<Iorek>
but, at the risk of sounding heretic, I miss a lot of things in modern IDEs that emacs lacks
<drWorm>
repent!
<Iorek>
:)
<drWorm>
emacs has all things, they are just well hidden and not so intuitive to use sometimes :)
<Iorek>
what I miss most are context-sensitive tools
<Iorek>
the emacs modes help with identation, syntax highlighting, compiling and debugging, but they don't help you write the code... it's not that big a deal, but it helps to "reduce friction"
<Iorek>
there's a dead sourceforge project for the eclipse ocaml plugin
<async>
do you guys use taureg, or the mode that comes w/ the distribution
<mattam>
tuareg in X, caml in console
<Iorek>
has anyone tried camaleon ?
<mattam>
nope :(
<mattam>
you can have completion and type information in emacs if i'm not mistaken
<async>
Iorek: yeah, i don't think its that great
<drWorm>
what is camaleon?
<async>
ocaml IDE
<drWorm>
ah
<async>
it's a very respectable effort, though
<ita>
Iorek: cameleon won't compile :-/
<_JusSx_>
where is wuuru?
<ita>
Iorek: (tried building cameleon on both mdk 9.2 && 10b)
<Iorek>
it seems it doesn't work with the latest lablgtk
<async>
Iorek: are you using 3.07?
<Iorek>
async: yep
<ita>
Iorek: yes
<_JusSx_>
l
_JusSx_ has quit ["BitchX: now with Olestra!"]
liralen has joined #ocaml
afkzze is now known as wazze
Iorek has quit []
Nutssh has joined #ocaml
<drWorm>
i'm trying to learn functors and the Set stuff. trying to make a Set for strings, i'm getting stuck at what can be seen at http://www.ii.uib.no/~haakon/tmp/ocamlerror.txt -- could anyone take a look and drop some hints please?
<Smerdyakov>
drWorm, a simple fix is to take out the ": Set.OrderedType" from the first line.
<drWorm>
Smerdyakov: hm, i saw that in the manual too, but isn't it a point to say which signature you're "implementing"?
<Smerdyakov>
drWorm, that bit limits the signature of the structure you're defining from a "supersignature" of Set.OrderedType to just Set.OrderedType.
<Smerdyakov>
drWorm, the problem is that it is important to know that StringOrderedType.t = string, but Set.OrderedType has t as an abstract type.
<drWorm>
Smerdyakov: so the type inference makes the connection?
<drWorm>
ooh, i see, hm
<Smerdyakov>
Not even that. It checks that the signature of your structure is compatible with OrderedType.
<Smerdyakov>
I.e., that it is a "subsignature" in some sense.
<drWorm>
ah, it's clearing, makes sense
<Smerdyakov>
Now, if you look up "where type," you'll see how to specify the sigbature of StringOrderedType" and still have it work.
<drWorm>
"where type"?
<Smerdyakov>
Yup. It's a pair of keywords in the language.
<drWorm>
i'd like to specify the signature at least for documentation/readability
<drWorm>
ok, i'll check it out, thanks
<Smerdyakov>
Oops. I think it's "with type" in OCaml.
<drWorm>
yeah, emacs didn't put any color on "where" :)
<Nutssh>
Don't you want to do a 'with' declaration?
<Smerdyakov>
SML uses "where type". :)
<drWorm>
wohoo, worked without the signature annotation
<drWorm>
Smerdyakov: do you mean "with" as in "match ... with"?
<Smerdyakov>
drWorm, no. Search for "with type" on that page.
<drWorm>
no, you don't, hm
<drWorm>
ah, it's right there
<Smerdyakov>
It's a completely different syntactic meaning for "with". Naughty OCaml designers. ;)
<drWorm>
reusing keywords to keep the syntax slim :)
<Nutssh>
I'm waiting for a language consisting entirely of '0'. :)
<drWorm>
unlambda comes pretty close
<Nutssh>
:)
<Riastradh>
Syntax causes cancer of the semicolon.
<Smerdyakov>
The human brain is hardwired to understand specific linguistic structure. HINT: it's not prefix. (So say the linguists)
<Nutssh>
What languages are they studying? :)
<Smerdyakov>
All
<liralen>
Smerdy - what do these linguists think of postfix?
<Smerdyakov>
liralen, I think it's just ass bad. All languages have a permutation of "subject verb object," and some permutations are very rare. I forget the details.
<Riastradh>
Smerdyakov, the linguists are obviously wrong, as Lispers get along quite fine.
<Smerdyakov>
Riastradh, that doesn't prove anything. You may just be working extra hard to deal with unnatural syntax.
<Riastradh>
The linguists may just be wrong, too.
<Smerdyakov>
Unlikely. There is some very convincing empirical data here.
<liralen>
I find it tempting to believe that the human brain can extend itself to handle 'unnatural' acts fairly well, but OK.
<Riastradh>
I'm not convinced.
<Riastradh>
Programming languages are not natural languages, anyways.
Demitar has quit [Read error: 110 (Connection timed out)]
<Smerdyakov>
Taking advantage of existing competences is always a plus.
<Riastradh>
And even if S-expressions are not perfect for human parsing, I sincerely doubt that the linguists would agree that ML's syntax is better.
<Nutssh>
English has that structure, but does chinese? (I don't know.)
<Riastradh>
And even if the linguists are right, the function syntax sucks anyways: it's still prefix!
<Smerdyakov>
Nutssh, there are universals in language that include a decision on subject/verb/object order. Or so we learned in the linguistics class I took.
<liralen>
Nutssh - as far as SOV goes, Chinese grammar works much like English.
<Smerdyakov>
Riastradh, but that is natural when you have only a direct object.
<liralen>
Nutssh - I think that Japanese and German have SOV or like.
<Smerdyakov>
Riastradh, when you have subject and object (i.e., two arguments), infix is closer to English.
* Riastradh
must depart.
<liralen>
also, 'as far as SVO goes'.
ita has quit [Remote closed the connection]
Nutssh has quit ["Client exiting"]
wazze has quit ["Learning about how the end letters on French words are just becoming more and more silent, I conclude that one day the French"]