[racket] Racket consultants

2012-02-15 Thread Neil Van Dyke
This is just a message to see who Racket-consulting-inclined is currently out there and would like to compare notes. To start, here are some frank thoughts based on my experiences consulting using Racket thus far. Pardon the run-on sentences in quick brain dump. I have been working as a con

Re: [racket] Puzzled with tail-recursion conversion

2012-02-15 Thread namekuseijin
thanks. Very subtle difference... definitely not a good idea to try to double an existing variable as an accumulator too... I reworked it to: (define (pi4 accuracy) (let helper ((k 0) (r 0)) (let ((this (* (/ (expt -1 k) (expt 4 k)) (+ (/ 2 (+ (* 4 k) 1))

Re: [racket] copy syntax properties

2012-02-15 Thread Ryan Culpepper
On 02/15/2012 01:28 PM, Jon Rafkind wrote: `datum->syntax' does not copy syntax properties from the 4th parameter to the new syntax object if the 2nd parameter is already a syntax object. What is the reasoning for this? Lexical context and source location are taken from the 1st and 3rd arguments

[racket] copy syntax properties

2012-02-15 Thread Jon Rafkind
`datum->syntax' does not copy syntax properties from the 4th parameter to the new syntax object if the 2nd parameter is already a syntax object. What is the reasoning for this? Lexical context and source location are taken from the 1st and 3rd arguments so it seems inconsistent for syntax proper

Re: [racket] Making a Racket function "recallable"

2012-02-15 Thread Phil Bewig
You might be interested in SRFI-41 . One of the examples is an infinite stream of fibonacci numbers. On Wed, Feb 15, 2012 at 1:50 PM, Joe Gilray wrote: > Danny is correct... ouch (/.\ <- covering my head in shame). > > Anyway to close the chapter on this, below

Re: [racket] Making a Racket function "recallable"

2012-02-15 Thread Joe Gilray
Danny is correct... ouch (/.\ <- covering my head in shame). Anyway to close the chapter on this, below is the final result using Danny's stream suggestions/code. I also have a non-streams version thanks to Erik (and Stephen and Joshua). -Joe #lang racket (require racket/sequence) ; a sequence

Re: [racket] Puzzled with tail-recursion conversion

2012-02-15 Thread Matthias Felleisen
If you systematically apply cps and then accumulator transformations, you get this: (define (pi3 accuracy) (let helper ((k 0)) (let ((this (formula k))) (if (< (abs this) accuracy) this (+ this (helper (+ k 1))) (pi3 .1) (define (pi3-cps accuracy) (let he

[racket] Puzzled with tail-recursion conversion

2012-02-15 Thread namekuseijin
Hello, this is not really racket-related, for I get same issue with larceny, for instance. I saw a function at reddit and tried reworking it into tail-recursion, but it baffles me why last version shouldn't work. ; original function: works (define pi (lambda (accuracy) (letrec ((helper

Re: [racket] Making a Racket function "recallable"

2012-02-15 Thread Danny Yoo
> I've learned a lot tonight.  I have been reading the manuals, but they are > hard to get your arms around when you are just starting out. Also it would > be great if the manuals had more and longer examples.  Have anyone looked > into doing a Racket "cookbook"? Some of the documentation is meant

Re: [racket] Making a Racket function "recallable"

2012-02-15 Thread Danny Yoo
On Wed, Feb 15, 2012 at 3:10 AM, Joe Gilray wrote: > The code that Danny wrote to create fib-stream works great with his > peek-fibs function, but I really don't understand stream-first. > > I wrote: > > ; function to use the fib-stream to generate a list of all fibs < n > (define (fib-stream-less

[racket] [Scheme Steering Committee announcements] R7RS public comment period

2012-02-15 Thread Marc Feeley
This message is being posted to various lists to inform members of the Scheme community on the development of R7RS. I am pleased to announce that the sixth draft version of R7RS ("small" language) has been completed by working group 1 and is now available at the following URL: http://trac.sac

Re: [racket] Making a Racket function "recallable"

2012-02-15 Thread Joe Gilray
The code that Danny wrote to create fib-stream works great with his peek-fibs function, but I really don't understand stream-first. I wrote: ; function to use the fib-stream to generate a list of all fibs < n (define (fib-stream-less-than-n n) (let ([fib-val (stream-first fib-stream)]) (if