The first question is: what is a list? Forget empty lists for a moment. Think 
about a list with a single real in it. According to your program, what does 
that look like?

You're defining lists in terms of pairs. Okay, so let's say you want a list, 
where the only element in it is the number 1.0. What does that look like, in 
terms of pairs. Maybe you have a pair where the "first" field contains 1.0. But 
what does the "rest" field contain? What is the *rest* of a list that only has 
one thing in it?




> On Nov 27, 2016, at 4:23 PM, Ben Ghanem Anis <ansebio2...@gmail.com> wrote:
> 
>> On Sunday, November 27, 2016 at 10:16:34 PM UTC+1, Jon Zeppieri wrote:
>> Well, okay, first your program needs to admit the possibility of an empty 
>> list. But once it does, see my previous message.
>> 
>>> On Nov 27, 2016, at 3:45 PM, Ben Ghanem Anis <ansebio2...@gmail.com> wrote:
>>> 
>>> Hey guys,
>>> I need some help ..
>>> I need to write two procedures .. first one should be able to insert a real 
>>> number in the right position in a list (that is by default sorted 
>>> ascending) made of pairs (make-pair), also i need to use the procedure to 
>>> write another one that is able to sort in an ascending way a whole list of 
>>> real numbers.
>>> I already did the first step(see included shot) .. but i'm really stuck
>>> Help!
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "Racket Users" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to racket-users+unsubscr...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>> <Untitled.jpg>
> And how could i make it accept empty lists ?
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to