From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
In functional languages can continuations be seen as a
functions-calls.
I find one of the great things about Ruby, how it combines
both object oriented programming (smalltalk) and functional
programming (scheme) in such an elegant way.
···
On Sat, 01 May 2004 11:53:38 +0200, Florian Gross wrote:
I think this sentence may be incorrect.
I mean, haskell, ocaml and lisp all does not have call/cc yet they’re
functional languages.
(actually I’m not sure if lisp, ocaml and scheme can be defined as
functional languages, cause they’re not pure ones, if I’m correct)
···
il Sat, 01 May 2004 12:29:59 +0200, Kristof Bastiaensen kristof@vleeuwen.org ha scritto::
From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
Or about some exotic way to classify langages? If someone could light up…
obviously you missed the R language The R Programming Language
I forget to tell about it.
I’ve read somewhere there are one-caracter-name langages for almost all
letters of the latin alphabet (A → Z). It seems it still lefts U, I and
T. If someone want to create a one-caracter-name langage, he should
hurry!
The original link where I found that is in french, look in the comments: Les spécifications du langage D sont arrivées - LinuxFr.org
In message “Re: Lazy evaluation (evil)” on 04/05/01, Kristof Bastiaensen kristof@vleeuwen.org writes:
From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
In functional languages can continuations be seen as a
functions-calls.
I have to mention callcc was added not because to make Ruby a real
functional language, but because we happened to succeed to implement
it, and there was no reason to remove.
From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
I think this sentence may be incorrect.
I mean, haskell, ocaml and lisp all does not have call/cc yet they’re
functional languages.
(actually I’m not sure if lisp, ocaml and scheme can be defined as
functional languages, cause they’re not pure ones, if I’m correct)
Ocaml is a functionnal langage of the ML family. It means it abuses of
pattern matching and allows for side effects. As far as I know, lisp and
scheme are pure functionnal langage as they don’t allow side effects.
But perhaps I’m wrong. And I’m often wrong.
About Ruby, I must tell I find it hard to see where Ruby is functionnal
langage. Coding recursivity in ruby is most of the time so uneasy. I
just wonder, if someone can explain, he’ll be welcome.
Lio
···
il Sat, 01 May 2004 12:29:59 +0200, Kristof Bastiaensen > kristof@vleeuwen.org ha scritto::
Lisp is more or less the original functional language. However, it’s pretty
multi-paradigm, as you can do procedural or even object oriented (and logic?)
programming with it. It’s just not a pure functional language like Haskell.
Same with Scheme and OCaml. They just encourage programming in a functional
style (Scheme and OCaml more so than Lisp, maybe).
I’d say lambda expressions are more of a defining characteristic of functional
languages.
call/cc is an important function, conceptually, though, since with it you can
implement arbitrary control flow constructs (like conditionals and loops). So
when people ask for things like resumable exceptions, we can do them in pure
Ruby.
You are right, I used the term “functional language” in a wrong
way. Ruby isn’t functional, because it doesn’t encourage a
functional programming style. A meant to say that Ruby treats
functions and continuations as first class objects (just as
in functional languages). You could take a scheme program and
rewrite it in Ruby. It is a pity that the current Ruby-interpreter
doesn’t handle tail-recursive call’s, I hope that will be in
Ruby 2.0.
Another point where Ruby would come short, is in
scoping rules. Ruby has no equivalent for scheme “let”.
Especially with the new local-scoping rules, I have the
impression that it isn’t possible to have block local
variables (or am I wrong?). Wouldn’t it be useful to have a
local indentifier, to mean the start of a new scope for
these variables:
a = “foo”
4.times do |i|
local a = i * i
end
puts a
=> “foo”
Kristof
···
On Sat, 01 May 2004 10:38:55 +0000, gabriele renzi wrote:
il Sat, 01 May 2004 12:29:59 +0200, Kristof Bastiaensen > kristof@vleeuwen.org ha scritto::
From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
I think this sentence may be incorrect.
I mean, haskell, ocaml and lisp all does not have call/cc yet they’re
functional languages.
(actually I’m not sure if lisp, ocaml and scheme can be defined as
functional languages, cause they’re not pure ones, if I’m correct)
I guess this really deserved to be called “pragmatism”
Yours,
Jean-Hugues
···
At 08:36 02/05/2004 +0900, you wrote:
Hi,
In message “Re: Lazy evaluation (evil)” > on 04/05/01, Kristof Bastiaensen kristof@vleeuwen.org writes:
From a conceptual point of view is callcc very important.
It is not just added because it may seem like a good feature,
but because it makes Ruby a real functional language (like scheme).
In functional languages can continuations be seen as a
functions-calls.
I have to mention callcc was added not because to make Ruby a real
functional language, but because we happened to succeed to implement
it, and there was no reason to remove.