<stepcut>
lets say a define a function: let opt_arg_func a ?(b="world") = print (a ^ " " ^ b);;
<stepcut>
in this case the label argument ~b is not actually optional?
TachYon has joined #ocaml
stepcut has quit [Read error: 110 (Connection timed out)]
TachYon has quit [Remote closed the connection]
lament has joined #ocaml
foxster has joined #ocaml
det has joined #ocaml
det has quit ["changing servers"]
det has joined #ocaml
det has quit [Remote closed the connection]
det has joined #ocaml
Sonarman has joined #ocaml
lament has quit [Remote closed the connection]
foxster has quit [Read error: 104 (Connection reset by peer)]
Sonarman has quit ["leaving"]
lament has joined #ocaml
det has quit ["ircII EPIC4-1.1.2 -- Are we there yet?"]
mattam has joined #ocaml
<pattern_>
caml light allows one to use "#infix" to make a postfix function in to an infix function
<pattern_>
is there something similar in ocaml?
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
pattern_ has quit [adams.freenode.net irc.freenode.net]
pattern_ has joined #ocaml
<pattern_>
caml light allows one to use "#infix" to make a postfix function in to an infix function
<pattern_>
is there something similar in ocaml?
lament has quit ["Did you know that God's name is ERIS, and that He is a girl?"]
<mrvn>
pattern_: functions starting with an infix operator are infix operator, like +!, ++++++, +-+-+-+- and such
<pattern_>
can they contain letters too?
<pattern_>
like "+foo" ?
<mrvn>
that would be + foo
<mrvn>
so no
<pattern_>
but "foo1" is not "foo 1"
<mrvn>
no, but +-*/ are special
<pattern_>
sounds like ocaml needs an "#infix", like caml light has :P
<pattern_>
not that it's a big deal to write postfix
<mrvn>
makes the grammar a lot more complex.
<pattern_>
just one extra statement?
<mrvn>
Allowing only a small set for infix operators keeps the grammar simple.
<mrvn>
Keeps it context free
<pattern_>
well, you did say that ocaml will let me define +- and +-+ and +-+- and +-+-+, etc
<pattern_>
it doesn't seem to prevent me from making lots of infix functions
<pattern_>
but it does prevent me from naming them in an intuitive fashion, if i can't use letters
<pattern_>
but, again, it's not a big thing... at this point i don't really see a need for a lot of infix functions
<mrvn>
If you need special names for them better use postfix.
<pattern_>
so, mrvn, i read your pfc timing rules suggestion on kuro5in
<pattern_>
i think it's a great suggestion
<pattern_>
it's what chess tournaments use
<pattern_>
i think it makes sense... don't know why so many people poo-poo'ed it
<pattern_>
something else that could be done is use rules similar to corewars
<mrvn>
more complex to setup
<pattern_>
you'd need a virtual machine, though, that would execute one instruction from each program per turn
<pattern_>
still, it would be fairer
<pattern_>
otherwise, like you pointed out, programs wouldn't be penalized for thinking too long
<pattern_>
an external timer could be used, just like a chess clock
<pattern_>
there are effectively two clocks, counting down to zero
<pattern_>
when one program thinks it's time runs... as soon as it moves it's time stops running down, and the other program's time starts running
<mrvn>
I know the way.
<pattern_>
the programs themselves won't have to be modified to use this method
<pattern_>
they just need to spit out a move as soon as they think of one
<pattern_>
and their move is what stops and starts the clocks
<pattern_>
and when either program's time runs out, they lose... just like in chess
<pattern_>
you might need to run the programs on two seperate, equal, and otherwise idle computers, though... or, as someone pointed out, programmers might be tempted to cheat by trying to hog resources
<mrvn>
Which is pretty hard to do. And you can just use the cpu time instead of the wall clock.
<mrvn>
You can run one programm at a time. let it run for the time the other prog used, then give it the move and meassure the time till it moves.
<pattern_>
which is pretty hard to do? hog resources?
<mrvn>
pattern_: yes. Without getting noticed.
<pattern_>
you can just fork :P
<mrvn>
Esspecially ifyou run only one porg at a time. Let them hog as much as they like. They are only wasting their own time.
<pattern_>
i like the idea of using cpu time, though
<mrvn>
The easiest thing is probably to start/stop each prog after each move and feeding in the oponents moves with a delay.
<pattern_>
if the earlier moves don't matter in one's calculation then there's no reason why you couldn't start the program from scratch each time, just feeding it the board position
<mrvn>
much more fun if they do.
<pattern_>
well, the series of moves could still form a full game
<pattern_>
but for a computer that's calculating the best move at a certain board position, it shouldn't matter what the earlier moves were
<pattern_>
though it's a different thing when humans play against one another, of course
<pattern_>
then again, i guess a computer may form a general strategy in the earlier part of the game, and try to follow through with it as the game goes on, just calculating tactics in every successive move (until it sees it has to change it's strategy)
<pattern_>
but that's probably much harder to program
mrvn_ has joined #ocaml
mrvn has quit [Read error: 110 (Connection timed out)]
<pattern_>
there may be some other solutions too... try searching for "eval" in the #ocaml logs at http://tunes.org/~nef/logs/ocaml/
<pattern_>
i gotta run, though
<pattern_>
bbl
<stepcut>
Once you know elisp, its very easy and natural to extend emacs. But then you want everything to be that way... like when I download a file from a website that ends in .ps.gz to ~/docs, the webbrowser should automatically decompress the file for me...
<whee>
stepcut: mine does :)
<stepcut>
:p
<stepcut>
which browser?
<whee>
safari
<whee>
which probably won't be of any use to you :)
<stepcut>
depends if konqueror has that feature...
<whee>
seems like an obvious option to have
<stepcut>
i have never seen it, but KDE has it config options all over the place
<stepcut>
maybe apple will port khtml to emacs next :p
<whee>
I hope they don't waste time on that :P
<stepcut>
i guess photoshop for emacs is out too then...
mattam_ has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
TachYon has quit [Remote closed the connection]
<stepcut>
whoa CDK contains all the functions I have always dreamed of
mattam_ has quit [Read error: 60 (Operation timed out)]
stepcut has quit [Read error: 60 (Operation timed out)]