<whee>
camlp4 definately needs to be distributed with ocaml, it's too powerful to not :|
docelic has quit ["ok later ppl"]
<whee>
bleh this whole camlp4 discussion on the mailing list is disturbing
<mr_bubbs>
yep
<whee>
is there some reason daniel refuses to just maintain camlp4 seperately and sync trees before releases?
<mr_bubbs>
don't know.. and I believe I don't care at this point :)
<whee>
heh
malc has quit [Read error: 110 (Connection timed out)]
docelic has joined #ocaml
skylan has quit [Read error: 104 (Connection reset by peer)]
skylan has joined #ocaml
docelic has quit ["Client Exiting"]
skylan has quit [Read error: 54 (Connection reset by peer)]
skylan has joined #ocaml
nerith has joined #ocaml
<nerith>
hi
<nerith>
is anybody dead ?
<mr_bubbs>
I'm dead
<nerith>
okay :)
<nerith>
i want a fun which takes a int and "give" the char in output
<nerith>
like chr
<nerith>
but
<nerith>
i want it give nothing it the int is 0
<nerith>
with chr, it puts a \000 :(
<mr_bubbs>
just have it match the arg given with 0 and return what you want, else, return what chr does
<nerith>
but i want to return nothing
<nerith>
and '' is not accepted :(
<mr_bubbs>
nothing is not the same as the return from chr
<nerith>
hum so it's impossible ?
<mr_bubbs>
and \000 is correct for 0
<nerith>
yes but it add it to my string and i don't want :)
<nerith>
i want that he had nothing when 0 is found
<mr_bubbs>
:)
<mr_bubbs>
I got what's going on, here
<nerith>
hu ?
<mr_bubbs>
can you move the chr fun down to where you are adding to the string?
<nerith>
it was my second though but more complex than the first way :(
<mr_bubbs>
you using Buffer to add the char to the string?
<nerith>
but if it's the only working way.... :)
<nerith>
no but i will :)
<mr_bubbs>
match an_int with 0 -> () | i -> Buffer.add_char buf i
<mr_bubbs>
could replace the () from 0 with another call to the function that does the match
<mr_bubbs>
and allow an exit point :)
<mr_bubbs>
that's '0' too
<nerith>
hum more complex than simple tests since i have only 3 expressions
<mr_bubbs>
hum :\
<mr_bubbs>
maybe there is another way.. I just don't know it
<mr_bubbs>
that should work, though :)
<nerith>
sorry away fex minutes
<mr_bubbs>
# let add_to_buf buf i = match i with '0' -> () | i -> Buffer.add_char buf i ;;
<mr_bubbs>
val add_to_buf : Buffer.t -> char -> unit = <fun>
<mr_bubbs>
# let b = Buffer.create 16 ;;
<mr_bubbs>
val b : Buffer.t = <abstr>
<mr_bubbs>
# add_to_buf b '1' ;;
<mr_bubbs>
- : unit = ()
<mr_bubbs>
# add_to_buf b '0' ;;
<mr_bubbs>
- : unit = ()
<mr_bubbs>
# Buffer.contents b ;;
<mr_bubbs>
- : string = "1"
<mr_bubbs>
# add_to_buf b '3' ;;
<mr_bubbs>
- : unit = ()
<mr_bubbs>
# Buffer.contents b ;;
<mr_bubbs>
- : string = "13"
<mr_bubbs>
:)
<mr_bubbs>
or something
<nerith>
hum buff are structures, professors assume that we don't know this (sorry for my english :( )
<mr_bubbs>
oop
<mr_bubbs>
sorry.. didn't know there were restrictions!
<mr_bubbs>
your english is fine
<nerith>
thanks :)
<mr_bubbs>
I dunno how else one would add a char to a string.. I think this is a pretty frequently asked question that I don't know the answer to, heh
<mr_bubbs>
except using Buffer :(
<nerith>
you think there is another way or no ideas ?
<mr_bubbs>
hmm...
<mr_bubbs>
can you use Printf.sprintf? :)
<nerith>
i don't know so surely not :D
<mr_bubbs>
:P
<mr_bubbs>
can I see what you have so far?
<mr_bubbs>
maybe in privmsg
<nerith>
i think that all i'm allowed to use is in the lessons
<nerith>
ok
<whee>
erm what are you trying to do again
<whee>
the Char/String modules don't have enough to pull it off?
<mr_bubbs>
they probably do
<mr_bubbs>
which is why I'm looking at what they are trying to do :)
<whee>
oh
pnou has quit [benford.freenode.net irc.freenode.net]
whee has quit [benford.freenode.net irc.freenode.net]
xtrm has quit [benford.freenode.net irc.freenode.net]
mr_bubbs has quit [benford.freenode.net irc.freenode.net]
xtrm has joined #ocaml
whee has joined #ocaml
pnou has joined #ocaml
Yurik has joined #ocaml
<Yurik>
re
<Yurik>
guys, anybody not sleeping?
<whee>
I'm not, not sure if I could help though :P
<Yurik>
pity :(
Yurik has quit [Read error: 110 (Connection timed out)]
inkedmn has joined #ocaml
<inkedmn>
i'm trying to set up ocaml in win98
<inkedmn>
(this is probably a very dumb question)
<inkedmn>
but, for some damn reason, i'm not able to execute any of the ocaml files outside the \bin directory (even though i've added it to my PATH)
skylan has quit ["Reconnecting"]
skylan has joined #ocaml
inkedmn has quit ["Client Exiting"]
skylan has quit [Remote closed the connection]
skylan has joined #ocaml
graydon has quit ["xchat exiting.."]
physarum has left #ocaml []
Yurik has joined #ocaml
Yurik has quit [Read error: 104 (Connection reset by peer)]
whee has quit ["Leaving"]
zack has joined #ocaml
taw has joined #ocaml
zack has quit ["Client Exiting"]
zack has joined #ocaml
mrvn has joined #ocaml
gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
mrvn_ has quit [Read error: 110 (Connection timed out)]
zack has quit [Read error: 110 (Connection timed out)]
zack has joined #ocaml
two-face has joined #ocaml
<two-face>
hi
<taw>
hi
<zack>
hi two-face
<two-face>
hello zack
zack is now known as zack|afk
zack|afk is now known as zack
* zack
is away: busy
docelic has joined #ocaml
<taw>
hi docelic
<docelic>
heyo
<two-face>
howdy
docelic has quit ["later"]
* zack
is back (gone 00:56:43)
<two-face>
how do you set ocaml indentation in vim?
<taw>
two-face: vim ? you heretic !
<taw>
emacs is the only true ditor
<two-face>
taw: i know :)
<two-face>
taw: i use emacs
<two-face>
but i just wanted to know
<two-face>
out of curioisity
<two-face>
just to compare
<taw>
so select vi mode in emacs ;)
<two-face>
i've never found better than emacs anyway
<two-face>
i'm learning elisp as well
two-face is now known as two-away
<zack>
two-face: I know how to do it, but after your "i've never foudn better than emacs anyway" ...
<zack>
two-away: ... I will never tell you :-)
<taw>
"there are two good editors on Unix: GNU Emacs and X Emacs"
<zack>
taw: false, emacs is not an editor, is an operating system :)
nerith has quit [Read error: 104 (Connection reset by peer)]
merriam has quit [Excess Flood]
merriam has joined #ocaml
<two-away>
zack: nah, emacs is a macro processor, editing capabilities is jsut a feature
two-away is now known as two-face
<two-face>
zack: please tell me that thingy
<zack>
two-face: BTW, the standard vi already has support for ocaml syntax
<zack>
you just have to add to your .vimrc something like:
<zack>
filetype indent on
<zack>
filetype plugin on
<zack>
then edit a .ml file
<two-face>
ok
<zack>
well, "plugin" line is not really related to indentation, but .... is nice ;)
<two-face>
ok, got it work
<zack>
you can also have it work with the revised syntax though, cfr the ocaml ML
<two-face>
ok
<two-face>
zack: i'm just comparing with tuareg mode
<zack>
ack
<two-face>
oh strange, it does not understand that it must go back to the first column
<zack>
when?
<mrvn>
That normaly means you have an error.
<mrvn>
Or you haven't typed enough yet.
<two-face>
mrvn: with vim mode?
<two-face>
zack: when the let is finished
<mrvn>
oehm, no tuareg
<zack>
post the code
<two-face>
mrvn: tuareg works fine
* zack
is away: afk
jao has joined #ocaml
<two-face>
i have question
docelic has joined #ocaml
<two-face>
there are methods with no parameter and others with (), what's the difference?
<docelic>
I think when given (1,2) means one argument with elements "1" and "2"... given 1,2 means 2 arguments
* zack
is back (gone 00:09:39)
<two-face>
zack: I've seen that daniel has removed anything related to camlp4 in ocaml makefiles (CVS)
<mrvn>
nope.
<two-face>
mrvn: in makefiles
<mrvn>
docelic: (1,2) is (<expr>) where expr is 1,2
<mrvn>
two-face: other topic
<two-face>
:)
<docelic>
mrvn: ok, thanks for correction
<zack>
two-face: ok, but until ocaml 3.07 this is not a problem for the debian packages
<zack>
two-face: from ocaml 3.07 we probably will have to switch to the camlp4 external repository
<two-face>
zack: i don't know if he did that with their agreement :p
<zack>
two-face: probably not :-D
<zack>
anyway "their" is not appropriate, is better "him"
<mrvn>
docelic: 1,2 is allways a pair and usually people () it for readability
<mrvn>
TCW: Die uptime ist schon noch tewas hoeher.
<mrvn>
ups
<two-face>
zack: since users want camlp4 in ocaml, i think he 's going wrong
<zack>
two-face: sure but probably users can benefit more from an external camlp4 if Daniel can have more freedom in its development
* two-face
thinks Jacques Garrigue is a genius
<two-face>
zack: i think he has freedom currently, he's just panaoïd
<two-face>
paranoid
<two-face>
I think I'm close to make my tiny Qt binding work
* taw
has one philosophical question
<taw>
let's say we have object X and objects Y generated by it
<taw>
which automatically become invalid if certain methods of X are used
<taw>
(and yes, I'm talking about GtkTextBuffer and GtkTextIter)
<taw>
how to implement that w/o compromising type safety ?
<two-face>
i did not understand :p
<taw>
to operate on GtkTextBuffer you use GtkTextIters
<taw>
but they become invalid if anything gets written to buffer (with a few exception)
<two-face>
sorry i can't help
<taw>
this is purely theoretical question
<zack>
a quick solution:
<zack>
each method of the dependent object calls a method of the dependent object (say isValid)
<zack>
which in turn
<zack>
calls an isValid method on the other object
<zack>
or hasChanged since ...
<zack>
if the object is invalid you can raise an exception
docelic has quit ["later"]
<zack>
I hope it was clear ...
<taw>
but all the usual ocaml safety is lost that way
<zack>
I doubt you can enforce such an invariant with ocaml type system ...
<two-face>
there are methods with no parameter and others with (), what's the difference?
<zack>
two-face: practically none, it's a matter of style
* two-face
thinks lablgtk source is hard to understand sometimes
<two-face>
zack: ok
<taw>
lablgtk is gtk1.2 only and this is gtk 2.0 problem
<zack>
is it possible to use ocamlyacc to parse a generic list or stream (i.e. not a stream generated by ocamllex)
<zack>
?
<taw>
it occured when i tried to use gtk2.0 from ruby
<two-face>
i've never used ocamlyacc
<taw>
and i decided to use "iterator specification" which is computed lazily on last moment instead of normal iterator
<two-face>
taw: jacques has not finnished lablgtk for gtk2, it will be released by the end of the year
<taw>
two-face: are there any betas to test ?
<two-face>
taw: not yet, but close to
mr_bubbs has joined #ocaml
jao has quit [Read error: 113 (No route to host)]
Segora has joined #ocaml
<Segora>
hi
<taw>
hi Segora
<taw>
Segora: are you doing anything interesting with ocaml right now
<Segora>
not really
<Segora>
just playing around
<Segora>
I used OCaml for prototyping some ideas for a project which in the end I unfortunately had to implement using C++
<taw>
c++ is very painful
<Segora>
yes. I feel it in my head and fingers all the time.
<Segora>
all that banging the head against the wall and RSI from too verbose a language...
<taw>
hehe, now imagine if you had to do it in pascal ;)
<Segora>
urgh
<taw>
that's main good point of c++ - it's better than pascal ;)
* Segora
laughs.
<mr_bubbs>
what was the reason for switching to C++? just curious
<Segora>
pascal's better than having to enter decimal machine code using POKEs ;)
<taw>
hmm
<taw>
maybe
<taw>
when i had to program in pascal i always ended withh half of code being like: procedure foo; asm REAL CODE end;
<taw>
mr_bubbs: i have seen so many things that were implemented in c, c++ or java just because "it's the right way" than i'm not asking such questions any more
<taw>
i'm not blaming them for not knowing ocaml, but most programmers never heard of things like perl and do text processing in c++
<mr_bubbs>
I see
<Segora>
mr_bubbs: my employer believes that it is easier to find someone to maintain it if it's in C++
<mr_bubbs>
so just a compatibility issue
<mr_bubbs>
in terms of people :)
<taw>
stupidity issue in fact
<taw>
"he believes"
<mr_bubbs>
okay.. I was just wondering
<taw>
that happens very often
<Segora>
well, I must admit I partially believe the same. I just met too many programmers who don't want to learn something new and rather stick to what they think they now.
<Segora>
s/now/know/
<taw>
if it was something at least remotely sane, like perl or lisp
<mr_bubbs>
I remember a few years ago, I'd bring my laptop over to a friend's house.. and he'd look at my screen and ask "what is that? what are you using? is that DOS? eugh, why aren't you using Windows?"
<taw>
then i wouldn't blame them ;)
<mr_bubbs>
that was Linux back then.. he hadn't heard of such a thing
<mr_bubbs>
nowadays, I bring my laptop over and he asks "are you compiling something in FreeBSD again?"
<mr_bubbs>
he still doesn't use it.. but he does accept it now
<taw>
but the difference between c/c++ and modern stuff is way too big
<mr_bubbs>
guess it heals with time?
<Segora>
mr_bubbs: I just give them one of my special looks in such a situation. Which normally results in them thinking they missed some terribly important point. :>
<taw>
mr_bubbs: not really, befoce they all wanted pascal or c, now they want c++ or java
<mr_bubbs>
heh
<Segora>
taw: the difference's not really that big if you do real software development. That's the fun part: Somebody has to grasp the same concepts to understand my C++ code as he would have to would the code be in OCaml...
<Segora>
funny, isn't it? In the end, the programmers that do maintain the code would have no problem learning the real thing.
<Segora>
fortunately I have support for using Erlang in another project.
<Segora>
up to the CTO, which is a nice thing to have
* taw
never seen erlang
<Segora>
taw: It's definitley worth a close look if you have lots of concurrency and want fault tolerance
* taw
never had lots of concurrency either
<Segora>
high availability is another thing
<Segora>
and if you want a distributed soft realtime database with transaction but without the representation gap. You can just story any Erlang term (including closures) in the database.
<taw>
remote closures ?
<Segora>
For standalone applications, OCaml's better suited, though.
<taw>
sounds nice
<taw>
is there corba for ocaml ?
<taw>
or something like that ?
<Segora>
taw: I know of CORBA for Haskell and Erlang. Let's see if there's something for OCaml, too...
<taw>
(corba and rmi are most distributed stuff i ever did)
<taw>
corba for haskell ? where ?
<Segora>
pse wait...
<taw>
mmm
<Segora>
google says: sourceforge.net/projects/haskell-corba/
<mr_bubbs>
you guys should check OCaml Humps for OCaml software
<Segora>
mr_bubbs: well, if google gives a relevant answer on the first hit for "ocaml corba" and "haskell corba", why should I bother? ;)
<mr_bubbs>
there may be more specific projects that may also suit you
<Segora>
right.
<taw>
2 - Pre-Alpha
<Segora>
unfortunately, The Hump only offers COM bindings
<mr_bubbs>
yeah.. I was suggesting it for other things
<mr_bubbs>
not specifically CORBA and such
<mr_bubbs>
google doesn't always get things right
<mr_bubbs>
but in this case, it fared better :)
<mr_bubbs>
writing an httpd in OCaml seems to be pretty fun, hehe
jao has joined #ocaml
* zack
is away: afk
two-face has quit ["Client Exiting"]
two-face has joined #ocaml
<two-face>
I'd like to express that a parameter of a method is a variable of a given class and its children class
<two-face>
isn't it #something ?
<mr_bubbs>
your expression has been duly noted
<two-face>
?
<two-face>
if b inherits a
<two-face>
i want to create a method which can have a or b variables in parameter
<two-face>
it looks like it is #a
<zack>
two-face: yes, #a means at least the methods that object a have
<zack>
two-face: yes, #a means at least the methods that object a has
<zack>
damned english! ;)
<two-face>
:)
<two-face>
ok thanks
<two-face>
i'm fighting with a not obvious case
<zack>
two-face: OO programming in OCaml is never obvious :)
<two-face>
:)
<two-face>
class qapplication :
<two-face>
([> `application] as 'a) Qt.obj ->
<two-face>
object
<two-face>
val obj : 'a Qt.obj
<two-face>
method exec : unit
<two-face>
method setMainWidget : #Qwidget.qwidget -> unit
<two-face>
end
<two-face>
The method setMainWidget has type #Qwidget.qwidget -> unit where ..
<two-face>
is unbound
<two-face>
WTF?!
<two-face>
what is .. ?
<mr_bubbs>
what the hell is [>
<zack>
you probably have a polimorhpic value inside the object, but the class isn't a polimorphic class
<two-face>
hmm
<two-face>
zack: something like that yes
<two-face>
zack: i think i need a constraint somewhere
<pnou>
tu peux pas avoir une méthode avec un type ouvert
<two-face>
pardon ?
<pnou>
setMainWidget's type is open
<pnou>
a value can have an open type but not a method
<pnou>
it's open because of the #
<two-face>
comment je fais alors ?
<pnou>
hum, pourquoi tu as besoin d'un type ouvert ?
<two-face>
pour passer un object
<two-face>
pour passer un objet
<two-face>
de n'importe quel type
<two-face>
descendant de qwidget
<pnou>
je sais pas si on peut contourner ça, en tout cas dans lablgtk dans pas mal de cas, il faut caster explicitement ton widget avec une méthode de ton widget
<two-face>
justement
<pnou>
du genre w#widget qui renvoint un type qwidget, et t'applique la méthode à ça
<pnou>
mais c'est vrai que c'est un peu plus lourd à manipuler
<two-face>
class qapplication obj =
<two-face>
object
<two-face>
val obj = obj
<two-face>
method exec = Qt.QApplication.exec obj
<two-face>
method setMainWidget (w : #qwidget) = Qt.QApplication.setMainWidget obj (w#as_widget)
<two-face>
end
<two-face>
comment je peux fermer ça ?
<pnou>
ben tu vires le #
<two-face>
bah non ça marche plus
<pnou>
et tu remplaces le w#as_widget par w
<pnou>
bref tu passes un vrai widget
<two-face>
il voudras plus des descendants
<pnou>
ben faudra que tu les transtypes avec ton #as_widget
<two-face>
hmm
<two-face>
ya pas moyen avec des constraint ?
<pnou>
je crois pas
<pnou>
mais vu que j'y comprends pas grand chose aux objects :)
<two-face>
arf
<two-face>
pnou: je vais regarder encore lablgtk + en profondeur
<two-face>
bye
two-face has quit ["Client Exiting"]
whee has joined #ocaml
<taw>
hohoho
<taw>
french Z
<taw>
why every programming language must have different natural language ;)
<mr_bubbs>
hehe
* taw
had lot of fun already with ruby and japanese
<mr_bubbs>
I like python
<taw>
i hope no language will ever have documentation in basque or suahili ;)
<mr_bubbs>
wasn't Latin supposed to be the answer to a global language or am I just plain wrong?
<taw>
well, most people are happy with using english for that
<mr_bubbs>
it seems to be
<taw>
and they never used latin in japan afaik ;)
<mr_bubbs>
:)
<taw>
latina mea ne bona est
<taw>
was this remotely correct ?
<mr_bubbs>
don't ask me!
* taw
haven't used latin for looong time
<taw>
i wonder wtf they still theach that
<mr_bubbs>
I think it is popular in some religious texts
<taw>
not at all nowadays, ever catholic church isn't using it any more ^_^
<mr_bubbs>
hah
<mr_bubbs>
how about old texts?!
<gl>
latin is useful, i think
<mr_bubbs>
I dunno.. maybe there is no reason
<gl>
sic transit gloria mundi
<mr_bubbs>
I see it used in mathematics, eh
<gl>
to know origins of manys words, too
<gl>
-s
<taw>
nihongo wa mou benri da to omou :)
<gl>
what's this ?
<taw>
japanese
<gl>
ooh
<mr_bubbs>
the nihongo gave it away for me, heh
<taw>
(oh, polish dosn't come from latin)
Torquemada has joined #ocaml
docelic has joined #ocaml
MegaWatS has joined #ocaml
zack has quit ["Client Exiting"]
<taw>
how can i trace function that sits inside some other ?
<MegaWatS>
I don`t think that`s even possible
<MegaWatS>
but I`m not sure
<mrvn>
What happens if you trace the outer function?
<taw>
well, it traces it correctly but it's no fun as only internal one is recursive
<whee>
you could use the debugger and set breaks
<taw>
mmm
<taw>
it is possible ?
<taw>
(well, i have debugged that by moving function outside and adding one more argument for time of debuging, but it's not very good solution)
<whee>
you should be able to use ocamldebug to follow execution of the inner function
docelic has quit [Remote closed the connection]
docelic has joined #ocaml
docelic has quit ["later all"]
zack has joined #ocaml
zack has left #ocaml []
<whee>
sigh
<whee>
when camlp4 was taken out of the cvs makefile I went and recompiled ocaml; now I can't use camlp4 because of a version mismatch
<whee>
great. I don't think I can recompile camlp4 to fix it now either
<whee>
nothing like wasting time because of childish actions :\
<taw>
mmm
<taw>
does anybody controls ocaml cvs ?
<whee>
the camlp4 guy is having some kind of argument with the ocaml team and went and disabled camlp4in the cvs tree
<taw>
oh
<whee>
which entirely screwed me up because I usually do daily recompiles of all my cvs utils
<taw>
argument about what ?
<whee>
heh
<whee>
I have no idea. you can try reading the caml-list thread on it
<whee>
it's pretty stupid whatever it is
<whee>
haha and now I can't even recompile ocaml
RichiH has joined #ocaml
<RichiH>
hi
<RichiH>
what editor do you propose for ocaml?
<taw>
xemacs
<taw>
well, some people use gnu emacs too
<taw>
chose whichever of these two you like better
* RichiH
is a vim guy
<taw>
weirdo :)
<RichiH>
so, apart from emacs, what do you propose?
<RichiH>
or do we just start a flamewar about editors? ;)
<taw>
well, there are 2 good editors for unix
<taw>
xemacs and gnu emacs
<RichiH>
i would like syntax highlighting and a hotkey or plugin or sth for testing my code
<taw>
that's exactly what you get with emacs
<taw>
oh, and install "tuareg" mode for ocaml
<RichiH>
i know, but i just don't feel comfortable with it .(
<taw>
it has more features than default caml-mode
<RichiH>
i know that, too, but it is still emacs
<taw>
so you need a little brainw^H^H^H^H^H^Htranining, so you will :)
<taw>
so put it in vi mode, you weirdo ;)
<RichiH>
it will still be emacs
<RichiH>
what will my mum think of me?
<RichiH>
they will drive me from my home and familiy
<RichiH>
-i
<RichiH>
declare my lawless, shot me on sight
<RichiH>
s/my/me
<taw>
well, half of the world uses some emacs, and we have no problems with that
* whee
swears by vim
<RichiH>
.oO(just because 1000 lemmings jump off a cliff, will you, too?)
* RichiH
cheers at whee
<taw>
well, i don't use windoze :)
<RichiH>
windows? who uses windows0
<RichiH>
?
<taw>
vim isn't for windoze ?
<RichiH>
!
<taw>
i thought that m stands for microsoft
<RichiH>
nah
<RichiH>
vi iMproved
<whee>
vim stands for VI iMproved
<taw>
hmm
<RichiH>
yay, /me found a ocmal file for vim
<whee>
I've been using vim for years. I'd never give up my tab completion during coding :D
<whee>
vim comes with one by default RichiH
<whee>
but there's one floating around for revised syntax that you might like, I found a reference to it on caml-list
<RichiH>
whee: but you can open a new fiel by just pressing ^h^t^v^c^j^h^v^n^i^j^f^c^v^m!
<whee>
hahaha
<whee>
that's precisely the reason I've never leared how to use emacs
<whee>
every time I try to run through a tutorial, my handsstart cramping up
<mrvn>
whee: you can just click at the file button.
<RichiH>
well, emacs the windows of unix :) always pressind 27 keys at the same time
<whee>
there are no buttons in the terminal :P
<mrvn>
or ctrl-x ctrl-f
<whee>
still, typing :e <file> is insanely quicker
<mrvn>
One should have a reachable ctrl key for xemacs
<whee>
I mean, what do I have to type for searching and replacing in emacs?
<whee>
in vim it's a simple :%s/old/new
<mrvn>
M-x %
<whee>
which involves no crazy meta keys and killing of my hands heh
<taw>
how to generate stream of random characters ?
<taw>
sit a new user before vi and tell him to quit
<mrvn>
and emacs can ask you about every replacement
<whee>
as can vim
<whee>
add a /c to the end of that previous one
<mrvn>
anyway. Vi can't be better than xemacs because it has a vi mode.
<RichiH>
vi != vim
<mrvn>
I'm sure the same is true for vim
<whee>
not quite
<mrvn>
given the insane amount of modes there are for xemacs
<RichiH>
and you can see that emacs is slowly moving to the better system ;p
<whee>
vim is a few order of magnitudes more powerful than vi
<RichiH>
or to put it another way: vi is crap :)
<taw>
and so is xemacs compared to vim
<mrvn>
whee: I ment there is probably a vim mode too
<whee>
does xemacs have a OS X gui? :P
<taw>
what's the point of editor if it doesn't even have a news client and irc
<taw>
these vim guys are weirdos
<mrvn>
and mudd client
<whee>
hfhha
<mrvn>
and mail client
<taw>
and cvs support
<mrvn>
and sokoban, tetris
<taw>
and ability to run shell programs
<taw>
and makefiles support
<mrvn>
and be a login shell even in place.
<taw>
it's not as funny as it sounds first
<whee>
vim does all of that that's related to text editing
<whee>
(and yes someone did write a tetris script)
<taw>
we should flood redhat with requests of makinf xemacs default shell in red hat 9.0
<mrvn>
In xemacs you can edit your source and then import that to your runtime system to try the changes.
<taw>
whee: text editing ? who needs that. it is always in relation with mail / news / irc / developement / etc.
<whee>
you mean compile it:? heh
<taw>
whee: so editor should support mail / news / irc / software devel directly
<whee>
taw: I use the right tool for the job.
<mrvn>
whee: no, paste it into the runtime system and bind it to the right namespace.
<taw>
that's very logical
<RichiH>
besides, "v i m" sounds way better than "eemaxx"
<mrvn>
feeding time
<whee>
in any case, emacs is an operating system I prefer to not run
<whee>
heh
<RichiH>
mrvn: feeding time? at 2141?
<RichiH>
2142
<RichiH>
anyway
* RichiH
is off again
RichiH has quit ["vim owns emacs tenfold!"]
Yurik has joined #ocaml
<MegaWatS>
lol
<Yurik>
re
<Yurik>
hi all
<Yurik>
taw: hi
<Yurik>
mr_bubbs: hi
<taw>
hi Yurik
* taw
have finally understood that f* type inference stuff
* Yurik
has sent first two version of ocamlns to caml-list, and Alessandro likes it :)
* Yurik
got ~ $40 and that is why drinking beer (last week budget was $2 :-))
<whee>
erm
<Yurik>
whee ?
<whee>
The implementation scanner.ml does not match the interface scanner.cmi:
<whee>
The field `SCANNER' is required but not provided
<whee>
attempting to figure out what that means. heh
<whee>
specifically the second line :|
<Yurik>
it is easy :)
<MegaWatS>
god damn how I hate java :(
<Yurik>
your cmi compiled from mli doesn't match ml
<Yurik>
java sucks :)
<whee>
right, but I don't know why
<MegaWatS>
that`s true :(
<whee>
my .ml implements all of the functions and types required
<Yurik>
whee: you can send it to me, I can try to resolve your problem
<Yurik>
MegaWatS: and that is good :) ocaml should be a chief industrial language
<taw>
hehe
<MegaWatS>
well right now I have to do something in java
<taw>
unfortunately ocaml lacks way too many libs now
<Yurik>
MegaWatS: only Pizza sucks less (since it introduces some good features to Java)
<taw>
Pizza sucks ?
<MegaWatS>
but that a language can make it so difficult to implement something as simple as an expression parser is really unbelievable :(
<taw>
ain't pizza meant for eating not sucking ?
<Yurik>
taw: i'm on guard :) i'm trying to do my best in supplying libs
<Yurik>
Pizza is pizza.sf.net
<taw>
oh ;)
* Yurik
had fixed serious error in OcamlBDB and will release in soon, and working on OCamlKerberos
<taw>
i would be really grateful if someone upgraded lablgtk to gtk 2.0, it has been over half year alrceady
<taw>
oh, and ocaml corba would be nice
<MegaWatS>
better, ideally classes/oop-based, stream standard libs would be nice in ocaml btw
<MegaWatS>
while we`re talking about libs
<Yurik>
yeah, ocaml-classes was first step on this
<Yurik>
but I think we can introduce new one, extended
<Yurik>
i thought of it recently, anyway
<Yurik>
and think some time I will do it
<Yurik>
i just can't program faster than I can
<taw>
:)
<MegaWatS>
=)
<taw>
Yurik: well, why do you want to change the world
<MegaWatS>
damn and why does java`s gc have to suck so very very much :(((
<Yurik>
taw: I like ocaml :-))
<Yurik>
MegaWatS: eek... java fgc really sucks, instead of ocaml's
<taw>
Yurik: well, normal people who like X just use X, and don't try to change the world ;)
<MegaWatS>
well it`s not that simple
<MegaWatS>
youcan`t always use what you want
<MegaWatS>
and sometimes you have to go tp where the libraries are
<Yurik>
whee: I've found a way to fix your problem
<Yurik>
taw: well, since I like X, I wanna improve it
<Yurik>
taw: to make it more usable for me
<whee>
yurik: which is?
<Yurik>
whee: add your module type to ml
<Yurik>
whee: I'm sending scanner.ml to you
<Yurik>
(dcc)
<whee>
and I'm attempting to figure out how to accept
<whee>
:D
<Yurik>
/ctcp something :)
* Yurik
forgot commands - he is using xchat
<whee>
hrmf
<whee>
didnt appear to send but I got it working
<MegaWatS>
hmm is the empty array, in java, equal to null?
<whee>
thanks
<Yurik>
or
<Yurik>
/ctcp ctcp yurik scanner.ml
<Yurik>
or
<MegaWatS>
I know wrong channel but :)
<whee>
what's the correct way to use .mli files?
<taw>
i think not
<MegaWatS>
compile them first?
<Yurik>
or
<Yurik>
bah
<Yurik>
not (i'm a bit drunk)
<taw>
but my java abilities are not that big
<Yurik>
/ctcp get Yurik filename
<MegaWatS>
thx anyway taw =)
<MegaWatS>
I`ll try with new String[0]; :)
<Yurik>
or /ctcp get filename Yurik
<Yurik>
MegaWatS: can you describe your problem precisely
<MegaWatS>
it`s not a problem
<MegaWatS>
I`m jst not sure, right now, whether in java, an array of size zero is the same thing as a null reference
<Yurik>
MegaWatS: ?
<Yurik>
MegaWatS: i had developed in java for a long period
<MegaWatS>
example:
<MegaWatS>
String[] arr = null;
<MegaWatS>
versus
<MegaWatS>
String[] arr = new String[0];
<Yurik>
i think java array isn't equal to null if it is empty
<Yurik>
however, I'm not sure
<MegaWatS>
thx
<whee>
it shouldnt be null
<MegaWatS>
ok that is 3 votes against null
<MegaWatS>
so I`ll do that
<MegaWatS>
thanks all
<Yurik>
however, /me is not sure
<Yurik>
the best method to know it is to test :)
<Yurik>
or read java specs :))
<whee>
I hate java.
<whee>
I had to use java for a year for school courses :\
<taw>
hehe
<MegaWatS>
hm
<taw>
in some schools they are using pascal ;)
<whee>
it was torture because of the way they forced us to use OO
<whee>
even for tasks that don't really require OO
<MegaWatS>
can you test strings for equality simpkly with '==' in java?
<whee>
yes mega
<MegaWatS>
thanks
<Yurik>
java really sucks, pascal sucks a lot more
<whee>
I think :D
<MegaWatS>
personally I like pascal a bit more than java
<whee>
I recall there being a couple string methods for doing tests, so I could be wrong there :\
<taw>
huh ?
<MegaWatS>
at least it doesn`t force itself on one`s programming style as much
<taw>
java is not that bad
<MegaWatS>
I really hate how in java, each class has to have it`s own source file
<Yurik>
however, our ukranian schools are teaching pascal. Universities teach pascal AND C usually
<MegaWatS>
which, to add insult to injury, has to have the same file name as the class
<whee>
you arent required to do that megawats
<taw>
pascal forces you too use damn-so-verbose-lower-level-than-even-asm style of programming
<whee>
you can define any classes you want in any file
<MegaWatS>
pascal on the other hand is basically just C with a different syntax
<MegaWatS>
not public classes
<taw>
no it's not
<whee>
the compiled bytecode will be the name of the class, but the source doesn't matter
<taw>
pascal is much more verbose and lower level
<Yurik>
MegaWatS: java classes could be in one file withing package
<MegaWatS>
so what differences between pascal and C exist, besides the fact that yiou can have (limited) functions-within-functions in pascal?
<taw>
hehe
<taw>
sounds like vim user
<taw>
emacs has no problem with editing 100 files at once
<whee>
neither does vim :p
<Yurik>
every language without functional styly of applying funcs sucks :))
* Yurik
is kidding
<whee>
I would actually agree with that yurik
<whee>
every time I have to use an iterator in c++ for example I just cringe :\
* Yurik
is thinking on the dillemma (or how it is in English): continue work on my E/AS Bauss project and making ocaml as good as it can be; or find a job (i'm again unemployed)
<MegaWatS>
well different languages have different styles
docelic has joined #ocaml
<whee>
the for_each and whatnot functions don't really make up for it either
<MegaWatS>
C++ sucks for lots of other reasons, though
<Yurik>
whee: yep! :)
<taw>
Yurik: you can have basic functional features in c++ by passing pointers to functions, using templates etc.
<taw>
Yurik: pascal can't even do that
<Yurik>
C++ is overloaded
<Yurik>
taw: but in C++ it is inhandy
<whee>
being able to construct new functions on the fly is what I'd lov e in c++
<taw>
well, you can use only features you want
<whee>
lambda expressions and the like, with partial evaulation :|
<taw>
bloated languages are good
<Yurik>
taw: and what about *partial* applience
<MegaWatS>
[22:15:23] <taw> bloated languages are good
<MegaWatS>
lol
<taw>
partial aplication sucks
<taw>
lambdas ought to be used for that
<whee>
I use it all the time
<Yurik>
bloated is a synonym for bad, am I right?
<Yurik>
:)
<taw>
lambda {|x| f (y, x)}
<taw>
that's the right wap
<taw>
no
<Yurik>
in ocaml you can do partial evolution, lazy expressions, functional appliance and so on :))
<taw>
bloated = having more feature than needed
<Yurik>
partial application rules
<Yurik>
it allows doing really good things
<Yurik>
and having more features that needed isn't bad, eh?
<MegaWatS>
bloated = more difficult to implement, restricting portability, and lessening choices of implementations
<taw>
huh ?
<MegaWatS>
that`s what I always kinda liked about the Wirth-family languages: they are all designed with "simplicity and ease of implementation" in mind
<Yurik>
btw, did anybody had used to test my ocamlns?
<taw>
i've seen more c++ implementations than of ocaml so far
<MegaWatS>
that`s got nothing to do with popularity, now does it? :)
<Yurik>
ocaml is ML, and there is a lot of MLs :)
<MegaWatS>
also I wouldn`t exactly call ocaml a very simple language
<Yurik>
j/k
<Yurik>
ocaml is simple, though
<MegaWatS>
but I like it better than other ml`s ... but really perfec would be a more streamlined ocaml
<taw>
ocaml is very bloated
<whee>
it'd be hard to reimplement ocaml, plus there's no point
<whee>
not exactly bloated
<MegaWatS>
it already carries quite a bit of unneccessary baggage of it`s own around
<whee>
I don't consider it bloated until it starts performing badly
<MegaWatS>
but I wouldn`t call it bloated yet
<MegaWatS>
c++, THAT is the standard for bloated
<Yurik>
as for me, caml needs some kinda standard
<MegaWatS>
a language isn`t really bloated until compiling it is undecidable :)
<mr_bubbs>
:)
<Yurik>
but until 4.0 will be released, i think caml can't have any standard
<taw>
rotfl
<MegaWatS>
but ocaml DOES share one feature with C++ and ada and the like: there is a very simple and elegant language inside of it, which desperately wnats to get out of it :)
<Yurik>
i just say one thing: in ocaml it takes a lot less time to implement my needs that in any other language I know
<MegaWatS>
that`s true for many things
<MegaWatS>
which is why ocaml is good
<Yurik>
(and I know a lot of them, including even Erlang :))
<MegaWatS>
erlang :D
<MegaWatS>
I once stumbled across a little language called "K" or somesuch
<Yurik>
i did a business application in erlang this year :))
<MegaWatS>
does anyone know anything about what THAT isall about?
<MegaWatS>
it seemed to me that language ws designed to make every program look as obfuscated as possible
<Yurik>
MegaWatS: K? did not heared about it
<MegaWatS>
but it was not an obfuscated language like unlambda or brainf*** per se
<Yurik>
obfuscation sucks
<mr_bubbs>
there is one called brainfuck, it looks like crap
* Yurik
had seen brainfuck :0)
* gl
too
gene9 has joined #ocaml
<MegaWatS>
it had real proponents, who really wanted to use it to do useful things, unlike brainf***, unlambda,intercal and the like which are just for fun
<Yurik>
gene9: hi
<gl>
<..>>>><<<<<<>>> <-- kind of bf source
<mr_bubbs>
yes
<Yurik>
bahbahbah! :) such kinda obfuscation really should be sent to a** (ass :))
<gene9>
hi, Yurik
<MegaWatS>
hehe
<Yurik>
gene9: how are you ?
<MegaWatS>
bf is nice :)
<MegaWatS>
i once wrote a bf compiler in ocaml
<taw>
mmm
<MegaWatS>
and an unlambda "uncompiler" in scheme X)
<taw>
lambda needs just a few characters
<Yurik>
you can implement kinda of bf in camlp4 :)))))))
<Yurik>
theoretically
<taw>
4 or 5 should be sufficient
<gene9>
thank you, nice, and you?
<MegaWatS>
which took a lambda expression and "unlambdaified" it
<Yurik>
gene9: unemployed again, bit the rest is good
<Yurik>
s/bit/but
<gene9>
it's a kind of curse
RichiH has joined #ocaml
<Yurik>
of what? (krivaya?)
<Yurik>
RichiH: hi
<RichiH>
hi
<gene9>
kind of proklyatie
<gene9>
it's hard to find good employer
<Yurik>
gene9: ah. proklyatie on me?
<RichiH>
when i do if 0 <= x < 0.75 then 2 *. x, it complains about 0.75 is float, but i want to use it with bool
<Yurik>
gene9: yeah! you're right.. :(((
<gene9>
on yours employment =)
<whee>
try 0.0
<whee>
richih
<mrvn>
0 <= x && x < 0.75
<whee>
and 2.0 and all
<Yurik>
RichiH: 0.0
<Yurik>
RichiH: and 2.0
<RichiH>
hmm, you are right with those two, but those aren't bool :)
<RichiH>
oh
* RichiH
just read what mrvn said
<RichiH>
sec
gene9 is now known as gene9_afk
* RichiH
hugs mrvn
<mrvn>
0 <= x : bool and bool < 0.75 --> 0.75 : bool
<MegaWatS>
ah i found it
<MegaWatS>
http://www.kx.com/index.htm <-- ths is the homepage of the company that develops that "K" programming language
<mrvn>
however bool < bool is defined.
<Yurik>
MegaWatS: and what for "K" is good?
<RichiH>
mrvn: true being greater than false, right?
<MegaWatS>
I dunno :)
<taw>
kde 4 will be rewritten in k++
<taw>
that's certain
<taw>
they can't stand anything that has 'c' in name ;)
* Yurik
hates TV set... I hear advs, advs and advs... baaah!
<RichiH>
hmm, it's amazing... in every channel i am, germans are most in numbers :)
<Yurik>
taw :)))))
<RichiH>
.oO(nich das es mir was ausmachen würde)
<MegaWatS>
:/
<mrvn>
world domination :)
<RichiH>
yay
<RichiH>
the third try ;)
<mrvn>
Aren't french running this channel?
<mr_bubbs>
I thought it was candians and aussies :)
<mr_bubbs>
dominating IRC, that is
* Yurik
can't understand most of german language :(
<MegaWatS>
ok poll: who here is from where?
<mrvn>
DE
<mr_bubbs>
US
<mrvn>
*hide*
<RichiH>
DE
<Yurik>
UA
<MegaWatS>
DE :)
<jao>
ES
<taw>
deutsche sprache ist sehr leichte ^_^
<taw>
PL
<RichiH>
s/leichte/leicht :)
<Yurik>
taw: I understand only first two words :)
<taw>
isn't 'sprache' feminine ?
<RichiH>
yep
<taw>
i was never good with gender system
<MegaWatS>
correctm, but the adjective doesn`t infelct with it
<mr_bubbs>
oh no, feminine and masculine language :(
<taw>
so shouldn't i add 'e' because of that ?
<RichiH>
Yurik: he said "the german language is very easy"
<docelic>
aber das Gesprach, ja ?
<RichiH>
taw: no
<RichiH>
docelic: yep
<mrvn>
deutschee sprache?
<MegaWatS>
der tisch ist schön - die tasse ist auch schön - und auch das las ist schön - no inflection of "schön", for example =)
<RichiH>
heh
<MegaWatS>
las = glas even
<Yurik>
RichiH: :)
<Yurik>
I know two languages, and only taw will understand a bit of them :))
* mrvn
lends MegaWatS a <shift>
<RichiH>
mrvn: not ion irc!
<taw>
hmmm, lot of time has passed since i last used german
<docelic>
i was learning it in school.. 9 years
<RichiH>
you don't heed any puntuation and/or splling rules while ircing ;)
<taw>
Yurik: jakie jezyki ?
<mrvn>
If we are mostöly germans here why do you keep talking french?
<Yurik>
taw: ukranian at least :)
* Yurik
understand polska mostly
<Yurik>
polish i mean
<RichiH>
mrvn: mostöly?
<RichiH>
:)
<MegaWatS>
ok so now about something about which I`ve always wondered, for those who are neither german nor french native speakers: which is more difficzlt - french or german?
<mrvn>
-ö
<RichiH>
hehe
<MegaWatS>
=)
* Yurik
just can't write in polish, but can speak
<RichiH>
MegaWatS: it would depends on your native language
<Yurik>
russian and ukranian are much complex :))
<Yurik>
but i know both :))
<mrvn>
Even though I'm german its still french thats ununderstandable. :)
<RichiH>
french is easier for italians, german is easier fr dutch
<MegaWatS>
I can only say that I always hated french in school with a passion 8(
<mrvn>
RichiH: and ameraicans are to dumb to learn a sceond langugae? :)
<taw>
german is easier for polish :)
<Yurik>
taw: why?
<RichiH>
mrvn: no, but apart from spanish, they don't really need it
<MegaWatS>
especially since french peopel don``t really speak anything like the language you learn in school as "french" B[
<taw>
Yurik: tons of borrowings between german and polish
<gl>
'we' talk about us ? :)
<Yurik>
jai voudrais acheter une ordinateur avec imprimant laser (I know, my written in French is AWFUL :))
<gl>
not too bad
<RichiH>
MegaWatS: you ever heard what they teach non-germans as german street talk? *horrible*
<Yurik>
taw: ah, so in ukranian, probable, since polish and ukranian are similar
<gl>
"je voudrais acheter un ordinateur avec imprimante laser" is more 'correct'
<MegaWatS>
I once tried to translate the classic "slaps around with big trout" into french but this is the best I got:
* MegaWatS
battes gl un peu avec une grande truite
<gl>
:)
<MegaWatS>
I think this is HORRIBLY wrong, thoug 8(
* gl
frappe MegaWatS a coups de grosse truite
<MegaWatS>
ah merci :)
<gl>
you're welcome!
<Yurik>
gl: thx. I remember "votre passporte" in CG aerogare
<RichiH>
anyway, gotta go
<RichiH>
(though i am sure to come back again and again and again
<RichiH>
)
<gl>
ok, cya
<MegaWatS>
bye richi
<whee>
okay quick question. if I wanted to build a list of filenames using Unix.opendir and Unix.readdir, how should I do it?
<whee>
right now I have a recursive function that uses Unix.readdir to append the next file to a list it's building
<whee>
but that may be slow with lots of files :|
<MegaWatS>
that`s how I would do it too
<MegaWatS>
hmm
<MegaWatS>
why?
<MegaWatS>
shouldn`t it all be buffered?
<whee>
hm?
<mrvn>
Build a list by attaching the name at the front and reverse it at the end.
<MegaWatS>
well that goes without saying
<mrvn>
Your way needs O(n^2) time, mine only O(n)
<mr_bubbs>
readdir won't be ordered anyway, no?
<MegaWatS>
you`re not appending stuff at the END of the list, are you? :)
<whee>
order doesn't matter
<whee>
and I'm prepending
<MegaWatS>
no I don`t think
<mr_bubbs>
so just ::
<whee>
I misspoke D:
<MegaWatS>
well then everything should be pretty fast
<whee>
okay. just checking if there wasn't a better way
<mrvn>
you just loop till readdir fails and then return the list
<whee>
yes
<mr_bubbs>
yep, catch eof
<mrvn>
let rec loop old_list = try readdir ... loop name::old_list with error -> list
<mrvn>
or something like that
<mrvn>
s/list/old_list
<MegaWatS>
no
<MegaWatS>
or
<MegaWatS>
hmm
<MegaWatS>
well if you do a try / catch around the recursive call
<MegaWatS>
it will take stack space with each call
<mrvn>
Why? Doesn't readdir throw an exception on EOF?
<whee>
I've got let rec build_file_list file_list = try let file = Unix.readdir dir in build_file_list [file::file_list] with [ End_of_file -> file_list]
<mr_bubbs>
mrvn: yes
<MegaWatS>
the recursive call should go outside of the try / with
<MegaWatS>
i.e.
<mr_bubbs>
no
<mr_bubbs>
heh
<whee>
errr
* Yurik
will drink about 5 bottles of beer shortly. Celebrating nothing :)
<mrvn>
MegaWatS: ah, yes. of cause. Thats malkes things a bit more complicated.
<whee>
if readdir throws an exception inside the recursive call how would I get the current list if I did it that way :|
<whee>
raises I mean
<mrvn>
let rec loop list = match (try Some (readdir) with error -> None) with None -> list | Some name -> loop name::list
<whee>
crazy java/c++ :(
<MegaWatS>
let rec loop_through_dir old_list = match (try Some (Unix.readdir dir) with End_of_file -> None) with Some file -> loop_through_dir (file :: old_list) | None -> old_list
<MegaWatS>
yes
<whee>
hmm okay
<mrvn>
MegaWatS: Wow, you used readdir before?
<MegaWatS>
no why?
<MegaWatS>
I just looked it up in my handy ocaml documentation :)
<mrvn>
looks likes its ready for cut&paste
<taw>
oh, how make ocamlbrowser and cameleon list all libs not just defaults ?
<Yurik>
btw
<MegaWatS>
well actually I would put the try Some etc stuff into a small helper function of it`s own
<MegaWatS>
like
<MegaWatS>
let maybe_read_dir dir = try Some (Unix.readdir dir) with End_of_file -> None
<mrvn>
by the way: I still think ocamls should define some important constants somewhere. Like Pi or E.
<MegaWatS>
yep
<MegaWatS>
ocaml doesn`t even come with a complex numbers library, does it?
<whee>
I think it does
<mrvn>
MegaWatS: What for?
<MegaWatS>
ah then I must have missed it
<Yurik>
anybody need a patch to ocamlbrowser that will browse not only ^, but recursively (useful for ocamlfind)?
<Yurik>
i'm just trying to make this patch from time to time... inspecting ocamlbrowser source to get an idea how to do it nicely
<Yurik>
MegaWatS: look at humps, there was something
<Yurik>
taw: but usually they can't find you smoking mj
* mr_bubbs
's head explodes
gene9_afk has quit [Read error: 110 (Connection timed out)]
<MegaWatS>
ah come on bf isn`t even that complicated
<mr_bubbs>
hehe
<MegaWatS>
UNLAMBDA is where it`s at! :C
<MegaWatS>
hey, don`t say anything I once wrote a program in unlambda that checked whether it`s input was an even or an odd number! :p
<Yurik>
taw: this word isn't avail ukranian... virtual jail means that you willn't be in prison, but you'll have criminal issues in your dossieu and some restrictions
<taw>
MegaWatS: input as church numeral ?
<Yurik>
taw: so, theoretcially it is a lot of problems
<Yurik>
:))
<MegaWatS>
taw: now, input as a decimal string - so its really easy, just wait for the last digit and check whether it is even or odd. translating it into church numerals at first, while it would have been more elegant, would have taken far too much memory I think :)
<taw>
well, here if they started to put every meth and mj user in jail they would have to increase capacity of jails x20
<MegaWatS>
at least, the conversion from the lambdaified version into the unlambda program
<Yurik>
taw :)) so mj is popular in poland?
<taw>
somewhat popular
<taw>
stats say that there were about 2 or 3 milions people used illegal drugs during last year
<taw>
most of people in age of ~20 have tried it at least once in their lifetime
<taw>
but for almost all of them it was only a couple of times
<Yurik>
taw: and what number of people is leaving in poland - how many millions?
<Yurik>
taw: as did I (I will be 21 next week :)
<taw>
38 mln
<taw>
there aren't many people who smoke it often
<Yurik>
taw: here 48 mln :) and not many people who some it often, too, but tried a lot for couple of times, too
<Yurik>
s/some/smoke/
* taw
haven't smoked it for ages
<Yurik>
for ages? does it mean that you've tried it (i'm weak at English :( )
<taw>
and there's a lot of nice legal accelerating stuff in apteki, so there's no real need for meth
<taw>
yeah, i have tried
<taw>
everyone had
<taw>
:)
<Yurik>
:)
<taw>
but it was long time ago
<Yurik>
btw, did you heared about Agata Kristi music band?
<taw>
no
<taw>
the only popular band from eastern europe is tatu ;)
* Yurik
too. I've not smoked mj for about 4 years
<Yurik>
taw: hahaha :)
<taw>
oh, and there was some latvian band, but they sing only in english
<Yurik>
taw: here people likes calling them "ta tu" - smthing like "she ... her"
<Yurik>
and in polska you listen tatu in russian?
<taw>
hehe
<taw>
well, they have two or three popular songs
<taw>
they even had big concert that was aired in polish tv a few weeks ago
<Yurik>
"nas ne dogonyat", "ya soshla s uma" ?
<taw>
yup
<Yurik>
how these titles could be translated into polska?
<taw>
'nie dogonicie nas'
<taw>
i don't understand the second
<taw>
what would it be in english ?
<Yurik>
second means something like "I gonna crazy (mad)"
<Yurik>
"I gonna mad, I need her"
<taw>
i'm gonna crazy = "zwiariuje"
<Yurik>
== "Ya soshla s uma, mne nuzhna ona"
<taw>
i need her = potrzebuje jej
<Yurik>
in ukranian it is "Ya zbigla z gluzdu"
<docelic>
yea we'd say 'sishla s uma' :)
<Yurik>
:)
<taw>
it's still #ocaml ?
<Yurik>
btw, my friend asks whether do you know Kirkorov (husband of Pugacheva)?
<taw>
irc should have channel autorenaming feature
<Yurik>
taw: yeah, #ocaml :)) but with usual talks :)
<taw>
husband of who ? ;)
<Yurik>
taw: every channel has topic shifts :)
<Yurik>
taw: Alla Pugacheva, was very popular in 80x in ex-USSR and may be in Poland
<taw>
in 80s
<taw>
that's soo long time ago
<Yurik>
~ 20 years ago :))
<docelic>
well depends how you look at it.. it could be only 10-13 yrs ago..
<Yurik>
yup
* Yurik
is listening music and waiting for more beer :) seems that this night I willn't develop :)
<whee>
heh
* Yurik
will make all envy ukranians: bottle of beer here costs less than 50c :-)
<taw>
mmm
<taw>
you use bottles ?
<taw>
we drink beer in cans :)
<Yurik>
bottles, cans and so on
<Yurik>
beer in can tastes not so good as in can
* Yurik
drinks canned beer sometimes
<Yurik>
beer in can tastes not so good as in bottle, i mean
<taw>
below 1 euro per .05 l can
<taw>
canned beer is polish tradition
<docelic>
you think that's cheap ?
<Yurik>
too much, only polish and chezh beer costs about 1-1.5 euros here. german and mexican a bit more, ireland about 3
<Yurik>
1.4 - 2 hrivynyas (UAH) is a price for ukranian beer here (euro is about 5.25 UAH)
<taw>
well, you can buy wine for 0.80 euro for 0.75l bottle ;)
<taw>
but i wouldn't drink that
<Yurik>
ukranian GOOD wine is cheap - about 1.2-2 euros, and it is very good
<Yurik>
i've even drinked 10 years wine for about 1.5 euros
<Yurik>
very good one
* taw
wonders if making own alcohol is still illegal here
<Yurik>
from the Crimea
<Yurik>
afair
<taw>
it certainly was during communism but i haven't heard of single issue last 10 years
<Yurik>
it is legal here, for own use
<Yurik>
it was illegal here in USSR too
<taw>
well, rice wine is nice thing
<Yurik>
rice?
<taw>
it takes only 3 weeks and is very strong ;)
<taw>
yup
<taw>
rice + sugar
docelic has quit ["later"]
<taw>
rice ferments extremely fast
<Yurik>
rice.. i don't remember this word
<Yurik>
"ris" in russian?
<Yurik>
or what?
<taw>
ryz
<Yurik>
may be really ris :)
<taw>
this chinese kasha-like food ;)
<Yurik>
ah, i was right
<taw>
how do you call it ?
<Yurik>
wine or rice?
<Yurik>
wine is "vyno", rice is "rys" in ukranian
* Yurik
thinks that drinking wine is barzo dobrze :)
<Yurik>
especially at night
<taw>
hehe
malc has joined #ocaml
<taw>
i don't drink it too much
<taw>
i was never really drunk
<Yurik>
friend delivered 10 bottles of *unfiltered* beer. Cool!
<taw>
unfiltered ?
<Yurik>
"Chernigivske bile nefiltrovane"
<Yurik>
yes, unfiltered. it tastes better
<mr_bubbs>
hey, malc
* Yurik
was drunk for a lot of times :( :)
<mr_bubbs>
:(
<malc>
mr_bubbs
* Yurik
is representative of strange youth group, half-hippie, half-punk, half-crazy, half-educated :-)
RichiH has joined #ocaml
* RichiH
again
<Yurik>
RichiH: wb
<RichiH>
is there some way to do sth unconditional in an if function?
<RichiH>
let f_x_1 x =
<RichiH>
x + 1
<RichiH>
if 1=1 then 1;;
<RichiH>
for example
<RichiH>
also, is there sth like elif?
Yurik has quit [Remote closed the connection]
* RichiH
pokes mrvn :)
<mrvn>
else
Yurik has joined #ocaml
<Yurik>
re
<mrvn>
That gives a syntax error
<RichiH>
mrvn: i need to do it before the ifs are gone through
<RichiH>
wb Yurik
<mrvn>
let f_x_1 x = x + 1 ; if 1=1 then 1 else 0;;
<RichiH>
mrvn: i know it gives a syntax error. that's why i asked if there was a way to do it
<mrvn>
or more properly:
<mrvn>
let f_x_1 x = begin ignore (x + 1); if 1=1 then 1 else 0; end ;;
<taw>
mrvn: why begin end is more correct than ; ?
<mrvn>
let f_x_1 x = let res = x + 1 in if 1=1 then 1 else 0; res;;
<Yurik>
hm
<Yurik>
what is ignore? I've not used it
<taw>
Yurik: i never heard of unfiltered beer
<mrvn>
Yurik: it throws its value away.
<Yurik>
taw: well, it is a great beer
<taw>
ignore() is extremely important function
<RichiH>
mrvn: nah, i need the value it returns .)
<Yurik>
mrvn: throws? what exactly does it mean?
<taw>
it casts any value to unit
<mrvn>
begin ... end properly shows where the multiple commands are. Sometimes you need them, e.g. if 1=1 then begin foo (); bar (); end
<RichiH>
mrvn: what does res do?
<mrvn>
RichiH: res is bound to x+1 so that is returned even though you have an if there.
<RichiH>
oic
<RichiH>
neat
<mrvn>
RichiH: In case you want to output some debug message after something is computed and still return it
* RichiH
begins to actually like ocaml
* RichiH
has to write all that down
<gl>
taw: you want to know why you must put a begin.. end?
<mrvn>
let bla x = let res = x+1 in Printf.printf "x is now %d\n" res; res
Yurik has quit [Read error: 54 (Connection reset by peer)]
<taw>
gl: yes i want
Yurik has joined #ocaml
<Yurik>
dialup sucks
<Yurik>
taw: so, if you want to some fresh unfiltered beer, you should come to Ukraine. However, it is not very hard for polish citizens :)
<Yurik>
j/k
<mrvn>
taw: Many constructs have an implicit begin...end, like let or match but if does not.
<mrvn>
taw: sometimes you need a begin...end to end something: match a with 1 -> begin match b with 0 -> () end 2 -> ();;
<mrvn>
s/2/|2/
<taw>
mrvn: why it doesn't ? show me single example when it would be ambiguous
<gl>
if you want to use sequence, you must put a begin.. end, or (..), cuz it's the syntax.. you can dodge parenthesis or blocs if all the elements of the sequence return unit() i think
<gl>
except the last one
<mrvn>
gl: nope. anythings that does not comupte to unit just gives a warning.
<gl>
i consider warnings as errors
<Yurik>
warning are semi-errors
<Yurik>
but however, avoid warning is a good way
<Yurik>
of programming
<Yurik>
I will avoid some warnings using ignore soon :-)
<taw>
when if would be ambiguous
<taw>
?
<mrvn>
taw: quite often you have a "if then else" inside a sequence. If if would have an implicit begin you would have to enclose each if in a sequence with begin/end.
<taw>
it doesn't have usual dangling else like in c
<Yurik>
btw, what do you think of literate programming, guys?
<RichiH>
gl is right. for example, if someone would warn me that there is no beer left, it would be an error of shopping()
<taw>
Yurik: sucks
<Yurik>
taw: why?
<mrvn>
taw: Its just specified to not have an implicit begin/else because thats more often what you want.
* Yurik
uses it and found it very useful
<mrvn>
Anyway, gotta watch the second half of Liberty.Stands.Still
<taw>
because i don't know any good program that does that ;)
<taw>
sounds like total waste of time
<Yurik>
all my recent works (OCamlBDB, OCamlNS, OCamlGettext, and so on and so forth) are written in literate programming and it was very useful for me while programming
<Yurik>
it says not only about documentation, but about useful structuring
<Yurik>
and i found it very useful
<taw>
structure of real programs change so often that it's just waste of time
<Yurik>
and I can assemble my program in a logically organized structure, mixing Caml, C code not by language difference, but by logical
<taw>
a few comments here and there are usually enought
<Yurik>
taw: they aren't often if you design seriously
<taw>
(* FIXME: problem *) and (* TODO: implement foo *)
<taw>
that's more or less whati is needed
<taw>
Yurik: never heard of iterative design ?
<Yurik>
seems that you don't know what literate programming is
<Yurik>
taw: something near extreme programming? :-)))
<taw>
yes, taw is extremist
<Yurik>
:)
<Yurik>
however, as for me, literate programming provided me with ability to structure programs, which is good for development of big projects
<whee>
literate programming sounds like work
<whee>
or documentation before actually programming
<whee>
heh
<Yurik>
in fact, I use LP mostly not for documenting, but for structuring (especially inter-language code)
<Yurik>
but as for me such kinda languages sucks, they are trying to raise smalltalk ideas.. but seems that in inproper way
<whee>
I'm getting a "Failure: uppercase identifier expected" when dealing with "value by_extension file = fun [ Scanner.file name dir Unix.stats -> name ];", referring to the "stats" part
<taw>
as it requires gnome 2 and other stuff
docelic has joined #ocaml
<whee>
any ideas? :|
<taw>
ruby = perl + list
<taw>
it has very little to do with smalltalk
<Yurik>
in 'everything is object' it is a smalltalk.. but smalltalk is anyway better
<RichiH>
the point of my question was dissing perl :)
<RichiH>
damn...
<taw>
perl is damn good
<whee>
anyone? heh
<RichiH>
i need to get offline, else i will never finish this .(
<taw>
it's the best thing that happened to computing ever
<Yurik>
perl sucks
<RichiH>
taw: i hate it's syntax
<RichiH>
heh
<RichiH>
flamewar again
<taw>
before perl no mainstream language had regular expresions, hash tables, cgi, sql, functional features
<whee>
oh haha nevermind, I typoed
<RichiH>
btw, vim rules and kwm is the best window manager. also, linux is better than *bsd and antialiased fonts are better
<RichiH>
did i forget anything? :)
<whee>
although I still have the error. blah
<taw>
now every new language has them
<RichiH>
taw: sharpened stones were great for cavemen, too. but i would rather use a knife for cutting. that's the way i think about it
<taw>
perl's map {} @foo; for (@foo) etc. were first functional features in any mainstream language
<whee>
lisp seems pretty mainstream to me
<taw>
it also had closures in times no real language had
<taw>
lisp ? mainstream ? gimme a break
<RichiH>
cu
RichiH has left #ocaml []
<Yurik>
lisp is a mainstream one
<whee>
yes
<whee>
lisp was pretty big back when it was starting
<whee>
in certain niches yes, but sitll
<taw>
in certain niches
* taw
is talking about mainstream not niches
<whee>
I could argue that perl is a niche language for text processing
<whee>
sure it's capable of more, but that's what it started as
<Yurik>
perl isn't mainstream, really
<taw>
whatever it started as, it is mainstream now
<whee>
perl isn't really that mainstream though
<Yurik>
perl? mainstream? for what?
<whee>
how many commercial products do you know of that are written in perl?
<Yurik>
it has its own niches
<whee>
can you go to a store and buy a program written in perl?
<whee>
they're all c/c++/blah from what I see :p
<taw>
most of cgi ever is written in perl
<whee>
that's a niche
<Yurik>
cgi isn't a niche?
* taw
is open source and will neverpay for software
<whee>
money makes the world go 'round :P
<taw>
it isn't just for cgi like niche php
<taw>
tons of usual programs are written in perl
<whee>
but only in certain niches
<Yurik>
tons of programs or special scripts?
<whee>
arguing that perl is mainstream is like arguing that linux is mainstream
<whee>
it might be mainstream from your point of view, but it's not really
<whee>
it's still a niche product
<Yurik>
afaik, lisp was used in a great couple of serious mainstream projects
<taw>
huh ?
<taw>
you need to argue that ?
* taw
understands not
<taw>
<whee> arguing that perl is mainstream is like arguing that linux is mainstream
<whee>
can you buy a prebuilt computer from the major computer companies with linux installed? (from all of the major companies)
<taw>
hmmm, yes
<Yurik>
ibm? dell?
<Yurik>
sun?
<taw>
whee is weird
<taw>
linux not being mainstream
<taw>
what next ?
<taw>
majority of servers here are linux
<whee>
there's far more many windows machines than linux in the user base
<taw>
on desktop
<Yurik>
that's true (on desktops)
<taw>
on servers windoze's popularity is rather low
<whee>
which is just another niche
<taw>
windoze exists only in desktop niche
<whee>
everything's a niche depending on how you view it
<taw>
real world uses unices
<Yurik>
so every product has its own niche :))
<taw>
well linux is used on desktops too
<taw>
windoze is desktop-only
<whee>
so is beos
<whee>
heh
<taw>
so windoze is niche product
<taw>
and so is beos
<whee>
and so is linux :p
<taw>
linux is for servers and desktops and hand watches and supercomputers
<taw>
and everything
<taw>
this is exactly opposite of 'niche product'
<mr_bubbs>
blah blah blah
<Yurik>
(/me is unix adept however) windows has server variants
<mr_bubbs>
what is this unix you speak of
<taw>
server ?
<whee>
I think I'll just finish my little project :D
<mr_bubbs>
:P
<Yurik>
w2k adv server?
<taw>
you call these single-processor intel boxes 'servers' ?
<Yurik>
i runned a lot of linux single|two-processor intel boxes as servers
<mr_bubbs>
so yeah, ehm
<Yurik>
they served
<Yurik>
so they are servers
<taw>
mini-servers
<mr_bubbs>
Yurik: what were some of your ideas for the OCaml community stuff
<Yurik>
mr_bubbs: ?
<mr_bubbs>
what we spoke of yesterday?
<Yurik>
mr_bubbs: i remember. my idea was to form some kinda small team that will try to supply ocaml with libs, extend it and popularize it
<mr_bubbs>
yes
RichiH has joined #ocaml
* RichiH
_again_
<Yurik>
mr_bubbs: since I've started such kinda program already
<Yurik>
RichiH: wb
<RichiH>
thx :)
<mr_bubbs>
which program?
zack has joined #ocaml
<Yurik>
zack: hi
<RichiH>
it's time for me to ask how many pasted lines you consider a flood...
<mr_bubbs>
>200
<mr_bubbs>
heh heh
* RichiH
got 7
<Yurik>
mr_bubbs: so I do it sometimes
<mr_bubbs>
when in doubt, join #flood, I suppose
<gl>
RichiH: show
<Yurik>
s/I/I will/
<gl>
7 is acceptable, i think
<RichiH>
let fmod x = x -. 1.5 *. floor ( x /. 1.5 );;
<RichiH>
let f_x_1 x =
<RichiH>
fmod x;
<RichiH>
if 0.0 <= x && x < 0.75 then 2.0 *. x
<RichiH>
else
<RichiH>
if 0.75 <= x && x < 1.5 then (2.0 *. ( 1.5 -. x))
<RichiH>
else failwith "" ;;
<RichiH>
when i do "f_x_1 4", it will get to the failwith
<gl>
f_x_1 4.0;;
<RichiH>
yes, i used 4.0 :)
<gl>
logical
<taw>
what's that ?
<RichiH>
the type handler wouldn't let me enter anything else, anywaay
<taw>
fmod x;
<taw>
oh
<gl>
RichiH: it's normal
<mr_bubbs>
Yurik: which kinda libs were you thinking? anything particular in mind at the moment?
<taw>
you didn't assing it anywhere
<gl>
let foo = fmod x in .. then replace x by foo, if i understand your code
<RichiH>
gl: what i want it to do is take the fmod'ed x for further computation
<RichiH>
gl: fmod is a modulo function for a float
<Yurik>
mr_bubbs: currently I'm finishing OcamlBDB (Berkeley DB), working on OCamlKerberos... but I think that first of we should wrap all main
<RichiH>
and f_x_1 is a simple description of a function graph
<malc>
# mod_float;;
<malc>
- : float -> float -> float = <fun>
<Yurik>
mr_bubbs: C libraries and provide some native ones that ocaml lacks
<mr_bubbs>
Yurik: I see
<malc>
inventing wheels are we?
<gl>
:)
<RichiH>
LOL
<RichiH>
we were told that there is no mod function in ocaml
<taw>
huh ?
<taw>
they lied
<RichiH>
apparently
<RichiH>
no mod for float, that is
<whee>
hooray for higher order functions. saving me a lot of time here
zack has left #ocaml []
<taw>
rotfl
<taw>
mod for floats
<RichiH>
that's a minus for our university, i gues :)
<taw>
what would that do ?
<taw>
modulo is for integer finite groups ;)
<whee>
you could mod the integer parts of both floats and add that to the decimal part of the floats
<whee>
not that that would work or is even useful
<taw>
mmm
zack has joined #ocaml
zack has left #ocaml []
<mr_bubbs>
anyone employed doing OCaml here?
<taw>
let fmod x y = x -. (y *.floor (x /. y));;
<Yurik>
nope :((
<taw>
mr_bubbs: no :)
<Yurik>
but i wanna be
<mr_bubbs>
heh
<RichiH>
taw: mod_float works like a charm. i already replaced it
<Yurik>
if everything will be ok in my project, next year or so I will be employed doing OCaml
<taw>
hehe
<RichiH>
but back to my original question: why isn't the new value of x taken for further computation?
<taw>
Yurik: you have very ambitious project
<taw>
RichiH: because you didn't told it should
<RichiH>
ok, how do i tell it?
<Yurik>
taw: I know :) But I strongly belive that I'll succeed
<taw>
i have one heuristic for all my projects - they will fail
<Yurik>
taw: (I'm not ocaml popularization project); i just have a project that uses ocaml as a main language
<Yurik>
taw: (I'm not about ocaml popularization project); i just have a project that uses ocaml as a main language
<taw>
oh
<taw>
i mean about failure
<taw>
they won't end with 'total succes'
<taw>
never
<RichiH>
taw: how would i tell ocaml to use the new value?
<taw>
RichiH: let x = new_x in ...
<gl>
i said it, RichiH
<taw>
so they should be designed in a way where half-success is more than waste of time
<gl>
"let foo = fmod x in .. then replace x by foo, if i understand your code"
<RichiH>
gl: oups, sorry :/
<gl>
np
<Yurik>
taw: anyway, I'm pleasured will my project development and guys that help me are too
<Yurik>
s/will/with
<Yurik>
i'm a bit drunk already :))
<Yurik>
however, i should go offline :(
<Yurik>
it is not cheap to be online at dialup
<taw>
Yurik: dobranoc
<Yurik>
cu all!
<gl>
bye
<Yurik>
taw: you too :)
<Yurik>
taw: na dobranic
* RichiH
can't get the syntax of gl and taw to work. what do i write after "in" and is "replace" a real command?
<taw>
RichiH: paste that again
<RichiH>
let new_x = mod_float x 1.5 in x = new_x;
<taw>
let f_x_1 x = let x = mod_float x in if 0.0 <= x && x < 0.75 then 2.0 *. x else if 0.75 <= x && x < 1.5 then (2.0 *. ( 1.5 -. x)) else failwith "" ;;
* RichiH
has to add that he has only used mainframe languages up to now and didn't even know about recursions until the day before yesterday
<malc>
mainframe?
<malc>
mainframe languages?
<RichiH>
ibm as/400
<RichiH>
rpg, cl, synon
<RichiH>
a big black box that crunches databases like no other :)
<malc>
you call this pathetic excuse for a computer as/400 a mainframe
<malc>
gee
zack has joined #ocaml
<RichiH>
well, it is a mainframe by desing
<mrvn>
RichiH: let new_x = mod_float x 1.5 in x = new_x; <-- where does thats new_x come from and why do you bind the first new_x to a bool?
<malc>
its piece of stinking crap
<malc>
oh well
zack has quit [Read error: 104 (Connection reset by peer)]
<RichiH>
mrvn: because my head is rotating with this syntax ;)
<mrvn>
taw: wouldn't an assert be better than failwith ""?
<taw>
mrvn: it's his code not mine
<RichiH>
malc: and you can say many things about an as/400, but it is stable, fast, reliable and it is great at databases
<taw>
RichiH: just paste what i written
<RichiH>
taw: creates an error
<mrvn>
RichiH: In functional languages you can't change the value of something. You allways make a new something with the new value.
<mrvn>
RichiH: exceptions excluded of cause.
<RichiH>
*pling*
<taw>
mrvn: it's ocaml not haskell, you can do it :)
<malc>
RichiH: oh thank you for permission to speak
<RichiH>
mrvn just told me sth very important
<malc>
sheesh
Yurik has quit [Read error: 54 (Connection reset by peer)]
<taw>
oh ;)
<taw>
what do you want to mod it with ?
<RichiH>
malc: it wasn't meant unfriendly
<RichiH>
1.5
<malc>
RichiH: it was downright insulting
<taw>
let fmod x = x -. 1.5 *. floor ( x /. 1.5 );;
<taw>
et f_x_1 x = let x = fmod x in if 0.0 <= x && x < 0.75 then 2.0 *. x else if 0.75 <= x && x < 1.5 then (2.0 *. ( 1.5 -. x)) else failwith "" ;;
<RichiH>
<malc> its piece of stinking crap <- who was?
<taw>
let f_x_1 x = let x = fmod x in if 0.0 <= x && x < 0.75 then 2.0 *. x else if 0.75 <= x && x < 1.5 then (2.0 *. ( 1.5 -. x)) else failwith "" ;;
<mrvn>
RichiH, taw: Replacing something is possible and sometimes easier to do but that should realy be the exception in a program. It slows down the code and makes generation garbage collection ineffective.
<taw>
mrvn: in real code you have to do this quite often :)
<malc>
RichiH: dude, i was talking about a machine, you need to improve your fucking social skills
<taw>
less often than in c, sure, but still
<mrvn>
taw: nah, avoid it
<taw>
i won't
<taw>
y'know objects are not functional at all
<taw>
they keep their state
<taw>
O in Ocaml is not functional
<RichiH>
malc: we aren't getting anywhere. let's just drop it
<mrvn>
taw: yeah, inside classes thats fine. OO is that way.
<mrvn>
taw: I tend to keep modifying code inside classes and try to be pure functional outside.
<taw>
mrvn: oh, and you have this tail recursion trick
<taw>
which is really a iteration :)
<taw>
under closet
<mrvn>
what tail recursion trick?
<mrvn>
without tail recursion functional programming just wouldn't fly.
<taw>
tail recursion is there just so you can have normal variables and pretend not to
<mrvn>
taw: It allows unlimited recursion depth without stack overflows.
<taw>
it's not true recursion
<whee>
on the outside it looks recursive and you write it as such
<whee>
but the compiler handles making it iteration
<taw>
let rec foo k n = if something k n then foo (k+1) n else something_else k n ;;
<taw>
that's how it useally looks like
<taw>
k is really a variable
<mrvn>
you can write everything tailk recursive.
<taw>
and people pretend it's not
<mrvn>
taw: many recent functional compilers use continuation passing style, which is just a fancy way of transforming a program into purely tail recursive form.
<mrvn>
taw: simplifies compilation a lot.
<taw>
anyway, the point is that so called "parameters" in tail recursive stuff are really variables
<mrvn>
taw: all parameters are variables.
<mrvn>
everything is a variable.
<taw>
no !
<mrvn>
or rather a binding
<taw>
binding is one thing, variable is another
<taw>
in many languages you can't modify parameter
<taw>
(in c you can, but that's different stuff)
<mrvn>
taw: thats other languages.
<mrvn>
functional languages only need bindings.
<taw>
bindings which car be changed is variable
<mrvn>
Not sure how well ocaml objects fit into that though.
<taw>
and tail recursion is all about changing these bindings
<mrvn>
taw: what do you call tail recursion that doesn't recurse?
<taw>
tail recursion doesn't recurse at all
<taw>
it only iterates
<taw>
recursion is when you have stack and such stuff
<taw>
tail recursion is just a way to introduce variables via back doors
<mrvn>
let rec foo x = foo (x + 1);; thats tail recursion
* RichiH
waves again
<whee>
it looks like a tail recursive function is iterating when you write it, but it's being compiled to iterative code
<mrvn>
let rec foo x = 0 and bar x = foo 1;; whats bar?
<whee>
errr recursing when you write it
<RichiH>
on the other hand, i learn ocaml thinking just by reading what you talk about
<mrvn>
whee: bar is tail recursive.
<mrvn>
and its not iterative
<taw>
this is about philosophical implications of denotational semantics, not about ocaml ;)
<mrvn>
Thats how I learned it
<taw>
bar is constant function
<mrvn>
Basically tail recursive is when you can implement it with a goto.
Yurik has joined #ocaml
<whee>
tail recursion implies being able to express it in an iterative form
<taw>
this rec creates more dependencies than actually exist