Re: [racket-users] Why doesn't this maxval function correctly return the maximum value in the list

2017-02-13 Thread Ben Greenman
Here's a version of your code that runs in the Intermediate Student language ("local" isn't part of Beginning Student): (define (maxval lst) (local ((define (aux lst max) (cond [(null? lst) max] [(> (car lst) max) (aux (cdr lst) (car lst))]

Re: [racket-users] Why doesn't this maxval function correctly return the maximum value in the list

2017-02-13 Thread Matthias Felleisen
You may wish to read up on the design recipe and the necessity of ‘local’ definitions in HtDP2e: http://www.ccs.neu.edu/home/matthias/HtDP2e/ > On Feb 13, 2017, at 3:46 PM, Angus Comber wrote: > > But it has to have the signature maxval lst - it is a homework

Re: [racket-users] Why doesn't this maxval function correctly return the maximum value in the list

2017-02-13 Thread Angus Comber
But it has to have the signature maxval lst - it is a homework problem. So I thought I would need max in the helper function. Basically to keep an internal max saved value. Is there another way? On 13 February 2017 at 20:38, Matthias Felleisen wrote: > > Just lift aux

Re: [racket-users] Why doesn't this maxval function correctly return the maximum value in the list

2017-02-13 Thread Matthias Felleisen
Just lift aux out. > On Feb 13, 2017, at 3:18 PM, Angus Comber wrote: > > If I change the code to: > > (define (maxval lst) >(define (aux lst max) > (cond [(null? lst) max] >[(> (car lst) max) (aux (cdr lst) (car lst))] >[#t (aux

Re: [racket-users] Why doesn't this maxval function correctly return the maximum value in the list

2017-02-13 Thread Angus Comber
If I change the code to: (define (maxval lst) (define (aux lst max) (cond [(null? lst) max] [(> (car lst) max) (aux (cdr lst) (car lst))] [#t (aux (cdr lst) max)])) (aux lst 0)) and comment out #lang racket at the top of the file and select Beginning Student as

Re: [racket-users] [Library Announcement] CSS-expressions, Pollen Component and Extensible Functions

2017-02-13 Thread Sean Kemplay
I will definitely check out the CSS package this weekend! On 13 Feb 2017 13:48, "Leandro Facchinetti" wrote: > Hi all, > > I’m here to announce three packages I published recently, because I want > feedback from the community: > > - CSS-expressions: S-expression-based CSS. >

[racket-users] [Library Announcement] CSS-expressions, Pollen Component and Extensible Functions

2017-02-13 Thread Leandro Facchinetti
Hi all, I’m here to announce three packages I published recently, because I want feedback from the community: - CSS-expressions: S-expression-based CSS. https://docs.racket-lang.org/css-expr/index.html - Pollen Component: Component-based development for Pollen.