gl has quit [Read error: 104 (Connection reset by peer)]
gl has joined #ocaml
gene9 has joined #ocaml
lament has joined #ocaml
gene9 has quit []
zack has left #ocaml []
ElCritter has joined #ocaml
<ElCritter>
hi
<ElCritter>
can you help me with a few questions?
<ElCritter>
im very new to caml, im using camllight right now for a project
<mattam_>
just ask
<ElCritter>
ok, i have this type definition:
<ElCritter>
type alfabeto = Alfabeto of char list;;
<ElCritter>
so that means that "alfabeto" is the name of the type?
<ElCritter>
hello?
<mattam_>
yes
<mattam_>
alfabeto is the type and Alfabeto it a constructor
<ElCritter>
so Alfabeto is a defined object? i mean i can use it right now?
docelic has joined #ocaml
<mattam_>
no, you must create an object: let abc = Alfabeto("a"::"b"::"c")
<mattam_>
then use abc
<ElCritter>
hmmmm ok!! thanks!!
<ElCritter>
i need to read a line from a file and store it on abc. I can use: let abc = read_line(file);; ?
<ElCritter>
i ask this because i dont know how to access a char list
<lament>
Perhaps Alfabeto(read_line(file))?
<ElCritter>
lament: let abc = Alfabeto(read_line(file));;
<ElCritter>
?
<lament>
I don't know
<mattam_>
ElCritter: you probably need to convert the string into a char list. Use: let conv s = let len = String.length s in if len == 0 then [] else (String.get s 0)::(conv 1 (len - 1) s);;
<mattam_>
this is recursive hence the 'rec' keyword in the definition
<ElCritter>
mattam_ lament thanks!
mattam_ has quit ["zzzZZZZzzzz"]
jao has joined #ocaml
graydon has joined #ocaml
<lament>
Does Ocaml have macros?
<graydon>
it has camlp4, a very powerful pre-processor
<graydon>
there is a simple #define-like thing which is shipping with newer versions, but the general camlp4 system is extremely extensible; you can perform any sort of lexing, parsing, syntactic substitution you like.
miraage has joined #ocaml
<lament>
Can you do stupid stuff with it, like in C?
<lament>
i.e. make it create syntactically invalid code
* miraage
grins
skylan has quit [Remote closed the connection]
skylan has joined #ocaml
<miraage>
if ocaml is so great, why isn't it more popular ?
<whee>
I ask myself that every day
<whee>
heh
<whee>
I think it's mostly because it's just a little weird to most people because they never really use functional languages
<lament>
Most modern languages are functional
<whee>
modern perhaps, but most popular languages these days are c/c++, java, perl/python/ruby, etc
<lament>
I don't know about c/c++/java, but perl, python and ruby are functional
<whee>
which are mostly imperative in nature, although some (python/ruby) are adding more functional features
<whee>
python and ruby are imperative with functional additions from my point of view
<lament>
of course if by functional you mean 'with first-class-functions'
<whee>
well that and things like partial evaluation and currying
<lament>
Hmm
<lament>
Then i guess even Lisp wouldn't be functional?
<whee>
lisp isn't modern :D
<lament>
But lisp is functional
<whee>
yes
<lament>
So your definition is wrong :)
<whee>
perhaps
<whee>
but I still don't consider python or ruby to be really functional
<whee>
they're starting to implement things that lead to a functional style, but it's an afterthought
<lament>
I think the term 'funcitonal' is meaningless here; perhaps you mean 'declarative'
<lament>
interestingly, my partial evaluation class in Python fits on a page :)
<whee>
I havent been tracking python development much so it might be good enough for me now heh
<whee>
but recently I remember looking at python 2.2's generators (I think that's what they're called) and thinking "welcome to last year"
<whee>
:D
<lament>
That doesn't have anything to do with the language being or not being functional :)
<lament>
Interestingly, C programs fare high on ICFP
<whee>
yes, but it's a feature that's common with functional languages
<whee>
more mature functional languages that is
<whee>
python may or may not be able to allow purely functional programming now, but it wasn't that way when it started
<lament>
Purely functional != functional
<lament>
Most languages have a (turing-complete) purely functional subset
<lament>
except perhaps BASIC :)
docelic has quit ["Client Exiting"]
<whee>
does python allow anonymous functions?
<lament>
yes
<whee>
smashing
<whee>
heh
<lament>
Of course, many a programmer use Python without ever using those. Python does tend to encourage imperative style
<lament>
(Imperative/OO)
<whee>
I'm tempted to get back into either python or ruby programming but I hate using objects all the time
<lament>
Heh
<whee>
waiting for perl6 :(
<lament>
Perl? Gosh, why?
<whee>
well I hate 5 but 6 looks like it might not be that bad
<whee>
ignoring the syntax
<lament>
I'd suggest python instead :)
<lament>
You can just forget they're objects ;)
<whee>
python doesn't offer anything new to me, though
<whee>
so there's no motivation D:
<lament>
Perl 6 does? Like what?
<whee>
I like the vectorized operators for one
<lament>
Hm, what's that?
<whee>
basically just syntactic sugar for applying an operation to a list or a hash (like map or whatever)
<whee>
nothing new really, but still different because of perl's odd way of doing things
<lament>
hm, that doesn't sound especially exciting :)
<whee>
it's nice to have an imperative language with shorthand for everything
<whee>
for those quick hackjobs heh
<lament>
Hm, I prefer elegance :)
<whee>
if only most people did :P
<lament>
Which, for me, includes as little punctuation as possible, among other things
<whee>
you'd love perl6 then :D
<whee>
they're considering using unicode for some of the operators
<whee>
must be running out of characters :|
<lament>
heh
<lament>
that would be rather sad if i cared about perl :)
<whee>
I hope they don't do it
<whee>
my terminal can't even display unicode correctly yet
<whee>
and I have no clue how to type it :P
<whee>
I think tonight is the night to learn camlp4 and add unicode operators though! heh
<lament>
hehe
<lament>
Forth is a good language in that aspects
<lament>
-s
<lament>
Forth words can contain absolutely anything
ElCritter has quit [Remote closed the connection]
<whee>
I never learned forth
<whee>
looks like something I don't want to learn as well :D
<lament>
It's quite educative
<lament>
It's more of a religion than a language, though
<whee>
just what I need, another religion to defend :D
<lament>
But it has some really neat (and extremely weird) ideas
lament has quit [Remote closed the connection]
lament has joined #ocaml
miraage has quit ["how to eat tree?"]
lament has quit ["mental mantle"]
graydon has quit ["xchat exiting.."]
mattam has joined #ocaml
jao is now known as jao_away
mrvn_ has joined #ocaml
smklsmkl is now known as smkl
mrvn has quit [Read error: 110 (Connection timed out)]
ayrnieu has joined #ocaml
smoke has quit [forward.freenode.net irc.freenode.net]
lament has joined #ocaml
smoke has joined #ocaml
ayrnieu` has joined #ocaml
ayrnieu has quit [Read error: 113 (No route to host)]
SoreEel has quit []
SoreEel has joined #ocaml
TachYon25 has joined #ocaml
lament has quit ["mental mantle"]
smoke has quit [Remote closed the connection]
smkl has quit [Read error: 113 (No route to host)]
graydon has joined #ocaml
ayrnieu` has quit [Read error: 60 (Operation timed out)]
mattam_ has joined #ocaml
lament has joined #ocaml
mattam has quit [Read error: 60 (Operation timed out)]
jankr has joined #ocaml
<jankr>
hi... the text to "Application Development with O'Caml", will it be printed by O'Reilly some day? (that is, the English version)
TachYon25 has quit ["bez ki³y nie ma zaliczenia (z prawd studentek AM)"]
smkl has joined #ocaml
skylan has quit [Connection reset by peer]
graydon has quit [Read error: 110 (Connection timed out)]
skylan has joined #ocaml
MegaWatS has joined #ocaml
lament has quit ["mental mantle"]
jao_away has quit [Read error: 110 (Connection timed out)]
owll has joined #ocaml
docelic has joined #ocaml
owll has quit ["Client Exiting"]
docelic has quit ["Client Exiting"]
lament has joined #ocaml
lament has quit ["mental mantle"]
graydon has joined #ocaml
jao has joined #ocaml
mellum has quit [Read error: 110 (Connection timed out)]
mellum has joined #ocaml
SoreEel has quit [Read error: 104 (Connection reset by peer)]