Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread David Storrs
Just realized that your list was sorted ascending, but for some reason, I latched into 'descending'. In the text below where I said 'smaller' it should say 'bigger'. "...put a number (x) on the front of a list if (first lst) is BIGGER than x. If (first lst) is not BIGGER..." On Sun, Nov 27,

Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread Matthias Felleisen
Ben, let me recommend you work thru the beginning of Part II of HtDP/2e, especially the chapter on Designing with Self-referential Data Definitions: http://www.ccs.neu.edu/home/matthias/HtDP2e/part_two.html

Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread David Storrs
Ben, I'm guessing that this is homework? Unless you have an artificial constraint stopping it, I would suggest that you take a look at the docs for Racket's built-in 'sort' function. Also, 'cons'. (See the 'Pairs and Lists' documentation.) As a more general hint, Racket is a functional

Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread Ben Ghanem Anis
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 wrote: > > > > Hey

Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread Jon Zeppieri
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 wrote: > > Hey guys, > I need some help .. > I need to write two procedures .. first one should be

Re: [racket-users] Very beginner Student who needs Help!

2016-11-27 Thread Jon Zeppieri
Okay, it might be more obvious how to approach the second procedure if we first consider a missing case in your first. What happens if you try to insert a real into an empty list, using your procedure? > On Nov 27, 2016, at 3:45 PM, Ben Ghanem Anis wrote: > > Hey

[racket-users] Very beginner Student who needs Help!

2016-11-27 Thread Ben Ghanem Anis
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