Re: [racket] streams, recursion and running out of memory

2012-02-21 Thread Joe Gilray
Hi Matthew, Thanks for your help. I really can't even pretend to understand the make-coroutine code but this is what I'm seeing: Original make-coroutine, without stream-ref pre-call => out of memory (1GB) when running (prime-pi 50) Original make-coroutine, with stream-ref pre-call => runs (p

Re: [racket] Multi-return Function Call

2012-02-21 Thread Anthony Carrico
On 02/21/2012 09:50 AM, David Fisher wrote: > The implementation looks good! Thank you, I do appreciate you taking the time to check it out. > It is indeed possible to implement ,\_MR > via exceptions, local continuations, or prompts as Anthony has here. > While I can't speak for Olin, I expect

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 6:24 PM, Don Blaheta wrote: > As an alternative, when I was teaching from HtDP last year I used the > pattern > > (define (list-blah lst) > (cond [(empty? lst) ...] >[(cons? lst) (cons-blah lst)])) > > (define (cons-blah lst) > (combiner (blah (first lst)) >

Re: [racket] Multi-return Function Call

2012-02-21 Thread Anthony Carrico
On 02/21/2012 09:32 AM, J. Ian Johnson wrote: > Perhaps I remembered wrong about interpretation, but I do know he > said that he didn't have a good implementation story Perhaps he just means that nobody has put it in a published compiler? > he must not > have been very satisfied with that journa

Re: [racket] sad user face?

2012-02-21 Thread SF
If it's fair to compare a woman's situation in a mostly-men field to a man's situation in a mostly-women field... Then, mentally putting myself in such a situation, I would probably feel pretty strange going to a club of more than, say, 5 other people who were all women and trying to socialize wit

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread Don Blaheta
Quoth Stephen Bloch: >That happens when you follow the HtDP design recipe directly and there are >conditionals for two unrelated reasons, e.g. >(cond [(empty? L) ...] > [(cons? L) >(cond [(snark? (first L)) ...] > [(boojum

[racket] anyone want to take over the drracket sicp support?

2012-02-21 Thread Neil Van Dyke
Anyone want to take over development of the DrRacket SICP support? http://www.neilvandyke.org/racket-sicp/ It could benefit from a few things: * Reimplement the language framework-y bits to be more consistent with the newer, documented ways of doing language framework-y bits. * Integrate the

Re: [racket] sad user face?

2012-02-21 Thread Neil Van Dyke
Neil Van Dyke wrote at Sun, 19 Feb 2012 05:40:56 -0500 (EST): John Clements wrote at 02/18/2012 08:48 PM: On Feb 18, 2012, at 5:43 PM, Luke Vilnis wrote: To weigh in on this - when I was an undergrad, women routinely called themselves "freshmen." I think this is becoming les

Re: [racket] exercise problem

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 3:18 PM, Roelof Wobben wrote: > Op 21-2-2012 20:51, Stephen Bloch schreef: >> >> On Feb 21, 2012, at 2:43 PM, Roelof Wobben wrote: >> >>> But now I get this error message : >>> unsaved editor>:27:23: function call: expected a function after the open >>> parenthesis, but fo

Re: [racket] exercise problem

2012-02-21 Thread Roelof Wobben
Op 21-2-2012 20:51, Stephen Bloch schreef: On Feb 21, 2012, at 2:43 PM, Roelof Wobben wrote: But now I get this error message : unsaved editor>:27:23: function call: expected a function after the open parenthesis, but found a part in: (tarief1 amount) When I do (tarief 1 amount) instead of ((

Re: [racket] exercise problem

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 2:43 PM, Roelof Wobben wrote: > But now I get this error message : > unsaved editor>:27:23: function call: expected a function after the open > parenthesis, but found a part in: (tarief1 amount) > > When I do (tarief 1 amount) instead of ((tarief amount)) Yes, that's where

[racket] exercise problem

2012-02-21 Thread Roelof Wobben
Hello, I try to make this exercise : Some credit card companies pay back a small portion of the charges a customer makes over a year. One company returns 1. .25% for the first $500 of charges, 2. .50% for the next $1000 (that is, the portion between $500 and $1500), 3. .75% for

[racket] Commercial Users of Functional Programming 2012: Call for Presentations

2012-02-21 Thread Michael Sperber
COMMERCIAL USERS OF FUNCTIONAL PROGRAMMING 2012 CUFP 2012 http://cufp.org/conference CALL FOR PRESENTATIONS Copenhagen, Denmark Sep 13-15

[racket] Problem with default-indices files in Web-Server

2012-02-21 Thread Gustavo Massaccesi
I wanted to make a 100% racket website (no html files), using the standard plt-web-server.exe (version 5.2.1, Windows). I need that all the pages are customized to each user. So I edited the configuration-table.rkt file to include the index.rkt in the list of default indices. ;-- ;Edited File: co

Re: [racket] streams, recursion and running out of memory

2012-02-21 Thread Matthew Flatt
I don't know the answer, but here's a piece of the puzzle that might be relevant. Try this alternate `make-coroutine': (define (make-coroutine fn) (let ([cont #f]) (λ () (call-with-continuation-prompt (lambda () (if cont (cont) (

Re: [racket] Changing the background color of a GUI button.

2012-02-21 Thread Matthias Felleisen
You could change the button child of the GUI and bring in a completely new button with a different color. -- Matthias On Feb 21, 2012, at 12:53 PM, Matthew Flatt wrote: > The idea of `set-state-normal' and `set-state-selected' sounds like a > `check-box%' rather than a `button%'. > > Otherwi

Re: [racket] Changing the background color of a GUI button.

2012-02-21 Thread Matthew Flatt
The idea of `set-state-normal' and `set-state-selected' sounds like a `check-box%' rather than a `button%'. Otherwise, there's no way to change the background color of a `button%' instance. Classes like `button%' correspond to platform-specific GUI widgets that typically either don't support or st

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread John Clements
On Feb 21, 2012, at 5:41 AM, Stephen Bloch wrote: > On Feb 21, 2012, at 7:18 AM, Rodolfo Carvalho wrote: > >> BTW I just found the nested-cond pattern appearing on HtDP, throughout >> section 9: >> http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html > > That happens when you follow the HtDP

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread Eli Barzilay
Yesterday, Laurent wrote: > Actually, there's a few more things it prints -- it's not intended to > be used without a human going over its output.  In case someone is > interested in such a project I can send out the code.  It could even > make a cute drracket tool that criticizes y

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Matthias Felleisen
Amen. On Feb 21, 2012, at 12:01 PM, Stephen Bloch wrote: > > On Feb 21, 2012, at 11:45 AM, Matthias Felleisen wrote: > >> How can they do that [read and modify code written by bad OO programmers] if >> we teach them only bad OO programming? > > I wouldn't suggest that, of course. The las

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 11:45 AM, Matthias Felleisen wrote: > How can they do that [read and modify code written by bad OO programmers] if > we teach them only bad OO programming? I wouldn't suggest that, of course. The last time I taught CS2 (or rather CS1 in Java, having been expressly forbidd

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Matthias Felleisen
How can they do that if we teach them only bad OO programming? On Feb 21, 2012, at 11:43 AM, Stephen Bloch wrote: > On Feb 21, 2012, at 11:40 AM, Matthias Felleisen wrote: >> You are right. We must teach students how to be bad OO programmers in CS2. >> Where else would they learn it? Plus the

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 11:40 AM, Matthias Felleisen wrote: > You are right. We must teach students how to be bad OO programmers in CS2. > Where else would they learn it? Plus they pay us for it. No, but we must teach students to read and modify code written by bad OO programmers. Stephen Bloch s

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Matthias Felleisen
On Feb 21, 2012, at 11:32 AM, Stephen Bloch wrote: > > On Feb 21, 2012, at 11:15 AM, Matthias Felleisen wrote: > >> If they were to write this code in Java ('CS2'), they wouldn't have conds >> for the outer part -- they'd use dispatch. > > Only if they were using polymorphic data structures.

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 11:15 AM, Matthias Felleisen wrote: > If they were to write this code in Java ('CS2'), they wouldn't have conds for > the outer part -- they'd use dispatch. Only if they were using polymorphic data structures. But most of the Real World uses null-terminated data structures

Re: [racket] style: nested cond (fine!)

2012-02-21 Thread Eli Barzilay
Just now, Matthias Felleisen wrote: > > Eli knows all this -- which is why he wrote that the tool cannot be > used without human post-processing. It isn't an automatic tool -- it > must be placed in context. There are two reasons for not being completely automatic. The first is a silly one: I di

[racket] style: nested cond (fine!)

2012-02-21 Thread Matthias Felleisen
On Feb 21, 2012, at 8:41 AM, Stephen Bloch wrote: > On Feb 21, 2012, at 7:18 AM, Rodolfo Carvalho wrote: > >> BTW I just found the nested-cond pattern appearing on HtDP, throughout >> section 9: >> http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html > > That happens when you follow the HtDP

Re: [racket] Multi-return Function Call

2012-02-21 Thread Danny Yoo
>  "It is possible to extend the basic notion of 'function call' to >  allow functions to have multiple return points. This turns out to be >  a surprisingly useful mechanism. This article conducts a fairly >  wide-ranging tour of such a feature..." Hmmm! I haven't done a deep look into the pape

Re: [racket] why here a endless loop

2012-02-21 Thread Rodolfo Carvalho
Hi, On Tue, Feb 21, 2012 at 12:49, Roelof Wobben wrote: > I have this script : > > (define (nettoloon h) > ( - (brutoloon h) (belasting h))) > > (define (belasting h) > (cond >[(< (brutoloon h) 240) (* 0 (brutoloon h))] >[(and (< (brutoloon h) 480) (> (brutoloon h) 240)) ( * 0.15 (bru

Re: [racket] sad user face?

2012-02-21 Thread Neil Van Dyke
Danny Yoo wrote at 02/18/2012 07:48 PM: So I'm looking at the Realm of Racket page at: http://realmofracket.com/, and the kid who is sitting on the left looks, well, unhappy. Is he dealing with a tough programming problem? Actually, he's dismayed that part of the blurb he's looking at, "[.

Re: [racket] Multi-return Function Call

2012-02-21 Thread Robby Findler
It seems possible to check that, no? Robby On Tue, Feb 21, 2012 at 8:50 AM, David Fisher wrote: > The implementation looks good!  It is indeed possible to implement ,\_MR via > exceptions, local continuations, or prompts as Anthony has here.  While I > can't speak for Olin, I expect that his poi

Re: [racket] Multi-return Function Call

2012-02-21 Thread David Fisher
The implementation looks good! It is indeed possible to implement ,\_MR via exceptions, local continuations, or prompts as Anthony has here. While I can't speak for Olin, I expect that his point is that implementing the transformations we discuss in the paper practically would require a (possibly

[racket] why here a endless loop

2012-02-21 Thread Roelof Wobben
I have this script : (define (nettoloon h) ( - (brutoloon h) (belasting h))) (define (belasting h) (cond [(< (brutoloon h) 240) (* 0 (brutoloon h))] [(and (< (brutoloon h) 480) (> (brutoloon h) 240)) ( * 0.15 (brutoloon h))] [else ( * 0.28 ( nettoloon h))])) (define (brutoloo

Re: [racket] Multi-return Function Call

2012-02-21 Thread J. Ian Johnson
Perhaps I remembered wrong about interpretation, but I do know he said that he didn't have a good implementation story - he must not have been very satisfied with that journal article. -Ian - Original Message - From: "Sam Tobin-Hochstadt" To: "J. Ian Johnson" Cc: "Anthony Carrico" , us

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread Stephen Bloch
On Feb 21, 2012, at 7:18 AM, Rodolfo Carvalho wrote: > BTW I just found the nested-cond pattern appearing on HtDP, throughout > section 9: > http://htdp.org/2003-09-26/Book/curriculum-Z-H-13.html That happens when you follow the HtDP design recipe directly and there are conditionals for two unr

Re: [racket] Multi-return Function Call

2012-02-21 Thread Sam Tobin-Hochstadt
That seems very surprising, since the journal paper (JFP 2006) about MRLC talks a lot about implementation strategies, and includes performance measurements for a compiler that implements MRLC. I think Anthony's implementation resembles the implementation in terms of exceptions discussed in sectio

Re: [racket] Multi-return Function Call

2012-02-21 Thread J. Ian Johnson
I don't have the time right now to go through your implementation, but I will say that I've talked to Olin directly about implementing \lambda_{MR} and he answered that it he could not think of any good implementation story beyond interpretation. -Ian - Original Message - From: "Anthony

Re: [racket] Style mistakes (was: static variables question)

2012-02-21 Thread Rodolfo Carvalho
On Mon, Feb 20, 2012 at 00:10, Eli Barzilay wrote: > 20 minutes ago, Rodolfo Carvalho wrote: > > It is possible to replace a pattern like this: > > > > (cond > >[..a..] > >[else (cond > >[..b..] > >...)]) > > > > With this simpler: > > > > (cond > >[..a