(define (p) (p))
(define (test x y)
(if (= x 0)
0
y))
(test 0 (p))
while i run these code in scsh,
the interpreter does not return.?
why? and what does "(define (p) (p))" mean?
On Thu, 14 Sep 2006 00:35:39 -0700, biran wrote:
> (define (p) (p))
> (define (test x y)
> (if (= x 0)
> 0
> y))
> (test 0 (p))
>
> while i run these code in scsh,
> the interpreter does not return.?
>
> why? and what does "(define (p) (p))" mean?
That looks like Scheme, and defines a function named `p' that takes no
arguments and when called calls itself - which again calls itself - which
again calls itself - which ..
In Lisp, that is Common Lisp - which is what is discussed (well, ok -
sometimes) here in `comp.lang.lisp' that would have looked like:
(defun p ()
(p))
For more about Scheme see `comp.lang.scheme'.
--
Lars Rune Nøstdal
http://lars.nostdal.org/
On Thu, 14 Sep 2006 09:43:22 +0200, Lars Rune Nøstdal wrote:
> In Lisp, that is Common Lisp - which is what is discussed (well, ok -
> sometimes) here in `comp.lang.lisp'
Come, now. They just shut down comp.lang.lisp.x and comp.lang.lisp.franz
with the justification that those who needed to discuss those dialects
could do so much more profitably in this group. comp.lang.lisp is a very
inclusive newsgroup, and excluding Scheme is just silly.
That said, there are Scheme-specific groups and, quite possibly,
scsh-specific groups as well.
--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
On Thu, 14 Sep 2006 14:22:39 -0600, Chris Barts wrote:
> On Thu, 14 Sep 2006 09:43:22 +0200, Lars Rune Nøstdal wrote:
>
>> In Lisp, that is Common Lisp - which is what is discussed (well, ok -
>> sometimes) here in `comp.lang.lisp'
>
> Come, now. They just shut down comp.lang.lisp.x and comp.lang.lisp.franz
> with the justification that those who needed to discuss those dialects
> could do so much more profitably in this group. comp.lang.lisp is a very
> inclusive newsgroup, and excluding Scheme is just silly.
Ok, then .. let's throw in some Ruby also; that's Lispy enough some think.
Or maybe Ruby is Perlish, while Python is the one more Lispy - I dunno.
Well, I don't care either way really. Since `comp.lang.scheme' exists,
maybe I'll ask my Common Lisp question there if "they" lack activity and
"need" to come here. :}
At least the OP know about both Scheme, `comp.lang.scheme', Common Lisp
and `comp.lang.lisp' now:
http://en.wikipedia.org/wiki/Lisp_programming_language
Now, what is the "best one"? O_o
--
Lars Rune Nøstdal
http://lars.nostdal.org/
On Fri, 15 Sep 2006 03:55:37 +0200, Lars Rune Nøstdal wrote:
> On Thu, 14 Sep 2006 14:22:39 -0600, Chris Barts wrote:
>
>> On Thu, 14 Sep 2006 09:43:22 +0200, Lars Rune Nøstdal wrote:
>>
>>> In Lisp, that is Common Lisp - which is what is discussed (well, ok -
>>> sometimes) here in `comp.lang.lisp'
>>
>> Come, now. They just shut down comp.lang.lisp.x and comp.lang.lisp.franz
>> with the justification that those who needed to discuss those dialects
>> could do so much more profitably in this group. comp.lang.lisp is a very
>> inclusive newsgroup, and excluding Scheme is just silly.
>
> Ok, then .. let's throw in some Ruby also; that's Lispy enough some think.
> Or maybe Ruby is Perlish, while Python is the one more Lispy - I dunno.
I know you're being facetious, but I would welcome a more diverse group of
languages. Logo, for example, is a (very, very simplified) Lisp dialect
that has largely done away with parenthesis because all functions have a
fixed arity. You can even write Lispy macros in Logo. It never seems to
get mentioned even in very inclusive listings of Lisp dialects that
capture languages such as Dylan and Smalltalk (largely because it never
gets mentioned /ever/ these days ;)), and I think increased
cross-pollination is a good thing.
>
> Well, I don't care either way really. Since `comp.lang.scheme' exists,
> maybe I'll ask my Common Lisp question there if "they" lack activity and
> "need" to come here. :}
>
Heh. Indeed. The two groups I mentioned in my first post to this thread
were both pretty much dead when they were finally rmgrouped and
comp.lang.lisp can easily absorb what little activity they generated.
> At least the OP know about both Scheme, `comp.lang.scheme', Common Lisp
> and `comp.lang.lisp' now:
>
> http://en.wikipedia.org/wiki/Lisp_programming_language
So this thread is not a complete waste, after all.
>
> Now, what is the "best one"? O_o
Obviously, the one for which you can get the best free implementation.
--
My address happens to be com (dot) gmail (at) usenet (plus) chbarts,
wardsback and translated.
It's in my header if you need a spoiler.
----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Chris Barts ha escrito:
> I know you're being facetious, but I would welcome a more diverse group of
> languages. Logo, for example...
While languages like Python, Perl, might have some similarities to
Lisp, Scheme is a direct dialect of Lisp, like CL.
And this group is named comp.lang.LISP, not comp.lang.COMMON-LISP, so I
think Scheme is apropiate here.
"Javier" <·······@gmail.com> writes:
> Chris Barts ha escrito:
>> I know you're being facetious, but I would welcome a more diverse group of
>> languages. Logo, for example...
>
> While languages like Python, Perl, might have some similarities to
> Lisp, Scheme is a direct dialect of Lisp, like CL.
> And this group is named comp.lang.LISP, not comp.lang.COMMON-LISP, so I
> think Scheme is apropiate here.
Indeed, while it's not a pure scheme specific question, in which case
cls is much more indicated.
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?
__Pascal Bourguignon__ http://www.informatimago.com/
From: Holger Schauer
Subject: Re: what does "(define (p) (p))" mean?
Date:
Message-ID: <yxzmz8xbeb9.fsf@gmx.de>
On 4762 September 1993, Javier wrote:
> Chris Barts ha escrito:
>> I know you're being facetious, but I would welcome a more diverse group of
>> languages. Logo, for example...
> While languages like Python, Perl, might have some similarities to
> Lisp, Scheme is a direct dialect of Lisp, like CL.
> And this group is named comp.lang.LISP, not comp.lang.COMMON-LISP, so I
> think Scheme is apropiate here.
It's not, for the simple reason that usenet is structured around
themes and comp.lang.scheme exists, i.e., there is a *more*
appropriate group for Scheme. There's probably a reason why it's
comp.lang.scheme and not comp.lang.lisp.scheme.
EOT for me,
Holger
--
--- http://www.coling.uni-freiburg.de/~schauer/ ---
Fachbegriffe der Informatik - Einfach erkl�rt
109: Fernschach
GUI auf 386/8 MB (nach Frank Klemm)
Holger Schauer ha escrito:
> It's not, for the simple reason that usenet is structured around
> themes and comp.lang.scheme exists, i.e., there is a *more*
> appropriate group for Scheme. There's probably a reason why it's
> comp.lang.scheme and not comp.lang.lisp.scheme.
There is no need to be so much rigid. Sometimes there are questions
which are of the interest of both CL and Scheme. In such situations,
cll is more apropiate than just cls, because cll is more general.
I know that a lot of people here consider Scheme a distinct language,
but I don't agree with that. Technically, Scheme is a Lisp dialect,
uses most of the syntax of CL, and have most of its features. This is
not the same as comparing Python with Lisp.
A lot of books teaching Lisp, takes Scheme syntax and/or semantic at
some point. Some of them even refers to Lisp when they are teaching
Scheme in fact. I don't think they are wrong.
"Javier" <·······@gmail.com> writes:
> Holger Schauer ha escrito:
>
>> It's not, for the simple reason that usenet is structured around
>> themes and comp.lang.scheme exists, i.e., there is a *more*
>> appropriate group for Scheme. There's probably a reason why it's
>> comp.lang.scheme and not comp.lang.lisp.scheme.
>
> There is no need to be so much rigid. Sometimes there are questions
> which are of the interest of both CL and Scheme. In such situations,
> cll is more apropiate than just cls, because cll is more general.
>
> I know that a lot of people here consider Scheme a distinct language,
> but I don't agree with that. Technically, Scheme is a Lisp dialect,
> uses most of the syntax of CL, and have most of its features. This is
> not the same as comparing Python with Lisp.
>
> A lot of books teaching Lisp, takes Scheme syntax and/or semantic at
> some point. Some of them even refers to Lisp when they are teaching
> Scheme in fact. I don't think they are wrong.
They're not wrong, but one of them still feels like Hugo (vs Bart).
--
__Pascal Bourguignon__ http://www.informatimago.com/
Nobody can fix the economy. Nobody can be trusted with their finger
on the button. Nobody's perfect. VOTE FOR NOBODY.
Javier <·······@gmail.com> wrote:
> Chris Barts ha escrito:
>> I know you're being facetious, but I would welcome a more diverse group of
>> languages. Logo, for example...
>
> While languages like Python, Perl, might have some similarities to
> Lisp, Scheme is a direct dialect of Lisp, like CL.
Indeed, Scheme is an ancestor of CL. Lexical scope is a big win.
--
Karl A. Krueger <········@example.edu> { s/example/whoi/ }
"Karl A. Krueger" <········@example.edu> writes:
> Javier <·······@gmail.com> wrote:
> > Chris Barts ha escrito:
> >> I know you're being facetious, but I would welcome a more diverse group of
> >> languages. Logo, for example...
> >
> > While languages like Python, Perl, might have some similarities to
> > Lisp, Scheme is a direct dialect of Lisp, like CL.
>
> Indeed, Scheme is an ancestor of CL. Lexical scope is a big win.
Actually, Scheme is more of a sibling or cousin of Common Lisp.
From the initial 1984 edition of Guy Steele's _Common Lisp: The
Language_, p.1:
"Common Lisp is a new dialect of Lisp, a successor to MacLisp,
influenced strongly by Zetalisp and to some extent by Scheme and
Interlisp."
Zetalisp (a.k.a. Lisp Machine Lisp) already had lexical scoping.
--
Thomas A. Russ, USC/Information Sciences Institute
"biran" <··········@gmail.com> writes:
Hmmm. My homework problem sensor just went off.
> (define (p) (p))
> (define (test x y)
> (if (= x 0)
> 0
> y))
> (test 0 (p))
>
> while i run these code in scsh,
> the interpreter does not return.?
>
> why? and what does "(define (p) (p))" mean?
But maybe it's not homework after all, but you could say where these
came from. I'm assuming that since you are asking about the meaning of
the code, you didn't write it yourself.
The definition question has been answered by Lars already.
As for the other question, you have to ponder the rules for evaluation
of forms in Scheme. What happens when you call
(test 0 (p)) ?
How doe the interpreter handle this?
If you know any other programming languages, is this any different than
what would happen in those languages?
--
Thomas A. Russ, USC/Information Sciences Institute
Thomas A. Russ wrote:
> "biran" <··········@gmail.com> writes:
>
> Hmmm. My homework problem sensor just went off.
>
>> (define (p) (p))
>> (define (test x y)
>> (if (= x 0)
>> 0
>> y))
>> (test 0 (p))
>>
>> while i run these code in scsh,
>> the interpreter does not return.?
>>
>> why? and what does "(define (p) (p))" mean?
>
> But maybe it's not homework after all, but you could say where these
> came from. I'm assuming that since you are asking about the meaning of
> the code, you didn't write it yourself.
It's from SICP, 2nd ed, exercise 1.5. The only difference is that the
exercise states that this definition is a tester to find
applicative-order and normal-order interpreters. It asks what the
expected behavior is on each type, and why.
Chapter 1 explains fully both the Scheme (define) syntax as well as the
meaning and behavior of the two kinds of parameter evaluation...
>
> The definition question has been answered by Lars already.
>
> As for the other question, you have to ponder the rules for evaluation
> of forms in Scheme. What happens when you call
>
> (test 0 (p)) ?
>
> How doe the interpreter handle this?
>
> If you know any other programming languages, is this any different than
> what would happen in those languages?
>
Of course, the full answer is for the OP to realize that frosh week is
over, and he should dry out and start attending classes and reading the
textbook. Maybe even ask his TA for help if he's stuck.
Sheesh, less than a month into his university career and he's already
wasting his tuition. It took me nearly three years to get that far
behind... :)
Iain McCracken <·························@gmail.dot.com> writes:
> Thomas A. Russ wrote:
> > "biran" <··········@gmail.com> writes:
> > Hmmm. My homework problem sensor just went off.
>
> >
>
> >> (define (p) (p))
> >> (define (test x y)
> >> (if (= x 0)
> >> 0
> >> y))
> >> (test 0 (p))
> >>
> > But maybe it's not homework after all, but you could say where these
>
> > came from. I'm assuming that since you are asking about the meaning of
> > the code, you didn't write it yourself.
>
> It's from SICP, 2nd ed, exercise 1.5. The only difference is that the
> exercise states that this definition is a tester to find
> applicative-order and normal-order interpreters. It asks what the
> expected behavior is on each type, and why.
Ah, this all makes a lot more sense now.
Certainly in the context of normal and applicative order evaluators,
this becomes a useful thing to have written.
--
Thomas A. Russ, USC/Information Sciences Institute