[plt-scheme] Re: Combining two definition into one only
SamuelXiao wrote: (let helper (( )())) ----> what does this means?
(let procname ((var value) ...) definition ... expr ...)
This is a named let form, quite something else than a plain let.
Look for "named let" in your notes. May be in a section about iterations.
Or look ifor named let in the index of "The Scheme Programming Language" by
R. Kent Dybvig or any other book about Scheme.
In your example procname is "helper" and is called recursively in the last
line.
Jos
----- Original Message -----
From: "SamuelXiao" <foolsmart2005 at gmail.com>
To: <plt-scheme at list.cs.brown.edu>
Sent: Friday, October 10, 2008 7:26 AM
Subject: [plt-scheme] Re: Combining two definition into one only
Excuse, I want to ask one more question, actually, for the let
statement:
(let helper ((unsorted numbers) ; The remaining unsorted values
(sorted '())) ; The sorted values
(if (null? unsorted)
sorted
(helper (cdr unsorted) (insert-number (car unsorted) sorted)))))
(let helper (( )())) ----> what does this means?
because in my notes and even the online materials:
( let ( {[ ‹id› ‹expr› ]}* ) ‹expr›+ )
the let statement should be sth like the above one.
what is the helper standing for?
On Oct 7, 12:53 am, SamuelXiao <foolsmart2... at gmail.com> wrote:
> Yes, you are right, actually, i am studying the scheme by taking his
> notes because in my school, the teacher's example is a bit simple.
>
> On Oct 6, 10:06 am, "Matt Jadud" <jad... at gmail.com> wrote:
>
> > On Sun, Oct 5, 2008 at 10:56 AM, SamuelXiao <foolsmart2... at gmail.com>
> > wrote:
> > > I am a scheme newbie, could anyone tell me how can i combine this
> > > following 2 definition into one?
>
> > This question[1] looks like it might be related to a set of problems
> > issued at Grinnell in the Spring of 2007[2].
>
> > I've CC:'d Samuel Rebelsky at Grinnell, as a lab of his was the only
> > page Google could find with the words "insert-number" and
> > "insertion-sort-numbers" that wasn't the Google Groups version of the
> > original posting.
>
> > And, if I've completely missed the mark, "oops."
>
> > Cheers,
> > Matt
>
> > [1]http://groups.google.com/group/plt-scheme/browse_thread/thread/ff785c...
> > [2]http://www.cs.grinnell.edu/~rebelsky/Courses/CS151/2007S/Labs/inserti...
> > _________________________________________________
> > For list-related administrative tasks:
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
_________________________________________________
For list-related administrative tasks:
http://list.cs.brown.edu/mailman/listinfo/plt-scheme