vezenchio has quit [""The law, in its majestic equality, forbids the rich as well as the poor to sleep under bridges, to beg in the streets, and t]
natv has quit [Read error: 110 (Connection timed out)]
UziMonkey has quit [Remote closed the connection]
Korollary has joined #ocaml
twobitsprit1 has left #ocaml []
mrsolo has quit ["Leaving"]
Smerdyakov has joined #ocaml
elk has joined #ocaml
pango_ has joined #ocaml
Herrchen_ has joined #ocaml
Nutssh has joined #ocaml
pango has quit [Read error: 110 (Connection timed out)]
Herrchen has quit [Read error: 110 (Connection timed out)]
gim_ has joined #ocaml
gim has quit [Read error: 110 (Connection timed out)]
monochrom has quit ["good morning, sweet dream"]
threeve has quit []
Smerdyakov has quit ["good"]
joeytwiddle has quit ["Leaving"]
__DL__ has joined #ocaml
booyaa has quit ["leaving"]
pango_ has quit [Remote closed the connection]
pango has joined #ocaml
pango is now known as pangoafk
Korollary has quit [Read error: 110 (Connection timed out)]
mlh_ has quit [Client Quit]
Submarine has joined #ocaml
<ulfdoz>
re
Demitar has quit [Read error: 110 (Connection timed out)]
Demitar has joined #ocaml
revision17 has quit [Read error: 110 (Connection timed out)]
__DL__ has left #ocaml []
Gueben has joined #ocaml
vezenchio has joined #ocaml
Benooit has joined #ocaml
Enig123 has joined #ocaml
Gueben has quit [Read error: 110 (Connection timed out)]
UziMonkey has joined #ocaml
CML has joined #ocaml
zhouwei_e has joined #ocaml
xidaux has joined #ocaml
xidaux is now known as Alpacasaurus
<vincenz>
I pruned it down to 124 lines by removing unnecessary featurs, but it's as far as I can go
<vincenz>
oops, wrong channel
Alpacasaurus is now known as xidaux
UziMonkey has quit [":q"]
xidaux has quit [Client Quit]
revision17 has joined #ocaml
Submarine has quit ["Leaving"]
Submarine has joined #ocaml
threeve has joined #ocaml
Benooit is now known as Gueben
Amorphous has quit [Read error: 110 (Connection timed out)]
Tachyon76 has joined #ocaml
meren[N\A] is now known as meren
meren is now known as meren[N\A]
Skal has joined #ocaml
elk has quit [Nick collision from services.]
elk has joined #ocaml
Amorphous has joined #ocaml
Tachyon76 has quit [Client Quit]
Snark has joined #ocaml
joeytwiddle has joined #ocaml
ronin_ has joined #ocaml
Enig123 has quit ["go sleeping now. bye~"]
Smerdyakov has joined #ocaml
ronin_ has quit ["Leaving"]
Korollary has joined #ocaml
TeXitoi has quit [Read error: 104 (Connection reset by peer)]
TeXitoi has joined #ocaml
meren[N\A] is now known as meren
xidaux has joined #ocaml
Korollary has quit [Read error: 110 (Connection timed out)]
UziMonkey has joined #ocaml
Gueben has quit [Read error: 104 (Connection reset by peer)]
Smerdyakov has quit []
CML has quit []
zhouwei_e has quit [Read error: 110 (Connection timed out)]
Gueben has joined #ocaml
pango has joined #ocaml
Nutssh has quit [Read error: 110 (Connection timed out)]
xidaux is now known as dodecahedron
twobitsp1ite has joined #ocaml
<twobitsp1ite>
ok, so I'm sure there's a way to create infix operators in ocaml, but I can't remember the syntax, and I'm having a hard time finding in any of the tutorials I'm looking at...
monochrom has joined #ocaml
<pango>
twobitsp1ite: IIRC, it depends on the first character of the operator
<pango>
twobitsp1ite: (operators that start with +, -, ... are automatically infix)
<twobitsp1ite>
pango: so... "let ( +# ) = ..."?
<pango>
give it a try
<pango>
seems # isn't allowed
<twobitsp1ite>
what are the argument names? i.e. "let ( +- ) = something left right"?
<pango>
just as another function definition
<pango>
let ( +- ) a b = ...
<twobitsp1ite>
ahh, I see
Submarine has quit ["in Soviet Russia, Céline Dion owns you"]
<twobitsp1ite>
pango: awesome, it works... thanks :)
<monochrom>
write a function that takes three parameters x y z and returns z*(x^^y). this can be done with tail recursion.
<twobitsp1ite>
monochrom: that's what I just did
<twobitsp1ite>
you have a paste site?
<monochrom>
I don't need to see it.
<twobitsp1ite>
ok, new question :) I know I can say "let f (first :: rest) = ..." but is there a way to do something like "let f (first :: rest) = ... | [] -> ..."?
Gueben has quit [Remote closed the connection]
Gueben has joined #ocaml
<pango>
let f = function first :: rest -> ... | [] -> ... ?
Submarine has joined #ocaml
<twobitsp1ite>
pango: i.e. have multiple patters without resorting to "match" or "function"...
<twobitsp1ite>
ohh
<pango>
not allowed
<twobitsp1ite>
hmm... I would imagine that it wouldn't be hard to add some sugar to the function notation...
<pango>
with little real benefit, however
<twobitsp1ite>
well... sugar exists solely for the comfort of the programmer anyways...
<twobitsp1ite>
I mean... I can do tail-calls in C, it's just not very pretty...
<pango>
compile can complain of non-exhaustive matches, but if you can add cases later, it's no longer possible
<twobitsp1ite>
it would work just like match...
<pango>
or you'd have to add other restrictions (all alternatives must be grouped with 'and's...)
<twobitsp1ite>
something like that...
<pango>
I not sure I'd like that syntax better
<twobitsp1ite>
maybe a "|="
<twobitsp1ite>
or "let f (f :: r) = rest || [] = [];;"
<twobitsp1ite>
ew... is the revised syntax going to be the next version of ocaml?
<pango>
probably not, it's been around for a long time
<twobitsp1ite>
I see
<twobitsp1ite>
ok, so can you define unary operations? i.e. something that would be use like "+- 4;;"?
Snark has left #ocaml []
<Msandin>
the revised syntax is an improvement, but it should be put to sleep, camlp4 lacks a lot of it's potential modularity because the exposed grammar stubs so few in order to keep them common to both syntaxes
<Msandin>
ocaml+camlp4 united under one syntax would be a much more convinient environment for syntactic extensions, converting everyone to revised is a non-starter, and so it should be declared deprecated and done in
<twobitsp1ite>
if they could just implement a macro system, or some way to influence the lexer at compile-time that would be nice
<Msandin>
what do you want that camlp4 can't do?
<twobitsp1ite>
er... I'm not familiar with camlp4... I was just assuming camlp4 was just another name for the "revized syntax"...
<twobitsp1ite>
so, camlp4 is a macro system for ocaml?
<Msandin>
camlp4 is a ocaml pre-processor/parser which can be used instead of the standard one when using ocamlc etc, it is extensible. ie camlp4 is a neat macro system for ocaml. the author of it used it to construct, among other things, the revised syntax
<twobitsp1ite>
I see...
<Msandin>
it's in the standard distribution, and people have done some quite neat syntactic extensions with it:-)
<twobitsp1ite>
also... is there some kind of "main" function, or do I always just have to throw a naked expression at the bottom of my files to be evaluated thus starting the program?