Re: [racket] recursion style question

2014-09-06 Thread Marc Burns
As Greg explained, the named let form simplifies the interface to other code. It is much more common in practice. > On Sep 6, 2014, at 23:50, Greg Hendershott wrote: > > Well, I think you answer your own question with good reasons in the > last paragraph. :) > > If `acc` is an implementation d

Re: [racket] recursion style question

2014-09-06 Thread Greg Hendershott
Well, I think you answer your own question with good reasons in the last paragraph. :) If `acc` is an implementation detail, let's not expose it as a parameter.[1] At least, let's not do this for a function provided by a module. Especially not a function with a contract and/or documentation. But

Re: [racket] typed racket cps, state machines

2014-09-06 Thread Matthias Felleisen
I am working with git head. -- Matthias On Sep 6, 2014, at 11:41 PM, Anthony Carrico wrote: > On 09/06/2014 02:00 PM, Matthias Felleisen wrote: >> >> p.s. I have figured out the syntax. I am not sure what you want with >> 'loop' but in any case, this all type checks. > > It is just a very de

Re: [racket] typed racket cps, state machines

2014-09-06 Thread Anthony Carrico
On 09/06/2014 02:00 PM, Matthias Felleisen wrote: p.s. I have figured out the syntax. I am not sure what you want with 'loop' but in any case, this all type checks. It is just a very degenerate case of my problems, with everything else gone, an infinite loop nested in the most basic polymorph

Re: [racket] gnucash and racket

2014-09-06 Thread Neil Van Dyke
Hendrik Boom wrote at 09/06/2014 08:56 PM: I gather that the current gnucash developer(s) have decided that they would like to distance themselves from guile. But it is still alive and well as its report generator. I was using Guile back when GnuCash was being developed in it. Guile seemed li

[racket] recursion style question

2014-09-06 Thread Kevin Forchione
Hi guys, Which is preferable? (define (foo let … (acc empty)) … (foo (rest let) ... (cons …. acc)) or (define (foo lst ...) (let loop ([lst lst] …[acc empty]) … (loop (rest let) … (cons …. acc))) On the one hand we eliminate the named let construct, but on the other hand we expose the acc i

Re: [racket] gnucash and racket

2014-09-06 Thread Hendrik Boom
On Sat, Sep 06, 2014 at 08:34:00PM -0400, Neil Van Dyke wrote: > What all have people done with using Racket with GnuCash? Racket I don't know. But the scripting language for gnucash, from the very beginning ages ago was guile, whch is a dialect of Scheme. In fact, at one time gnucash was a gui

[racket] gnucash and racket

2014-09-06 Thread Neil Van Dyke
What all have people done with using Racket with GnuCash? I know that John B. Clements wrote a package for doing reports from the ".gnucash" file. (My immediate motivation is that I'd like to be able to use my "html-template" Racket package to do reports that are integrated into the GnuCash

Re: [racket] Continuation marks

2014-09-06 Thread Gustavo Massaccesi
Thanks to everyone. It's much clearer now. I tried to get the same output anyway. This is the closest I could get. The example involves a little of "cheating", because the add-cm-x function actually never return in the traditional sense, but it use call/cc and abort/cc to get the same effect. Per

Re: [racket] typed racket cps, state machines

2014-09-06 Thread Matthias Felleisen
This type checks fine in v6.1 though I can't read the dang syntax and I thought I was someone who should be able to do just that :-) On Sep 6, 2014, at 1:46 PM, Anthony Carrico wrote: > Even something like this won't type check: > > (define #:∀ (V) (fn (r : V)) : V > (define (loop) : Void (l

Re: [racket] typed racket cps, state machines

2014-09-06 Thread Matthias Felleisen
p.s. I have figured out the syntax. I am not sure what you want with 'loop' but in any case, this all type checks. On Sep 6, 2014, at 1:58 PM, Matthias Felleisen wrote: > > This type checks fine in v6.1 though I can't read the dang syntax and I > thought I was someone who should be able to

Re: [racket] typed racket cps, state machines

2014-09-06 Thread Anthony Carrico
Even something like this won't type check: (define #:∀ (V) (fn (r : V)) : V (define (loop) : Void (loop)) r) So all that stuff about cps-ish code may be irrelevant. -- Anthony Carrico signature.asc Description: OpenPGP digital signature Racket Users list: http://

Re: [racket] Continuation marks

2014-09-06 Thread Jens Axel Søgaard
2014-09-06 16:36 GMT+02:00 Gustavo Massaccesi : > I'm trying to understand continuations marks. The second chapter of Johns dissertation "Portable and high-level access to the stack with Continuation Marks" gives a nice introduction. http://www.brinckerhoff.org/clements/papers/dissertation.pd

Re: [racket] Continuation marks

2014-09-06 Thread Matthew Flatt
The 'preserves-marks flag makes sense only in the context of the JIT's implementation. At the Racket level, there's no way to write a function `f` so that (with-continuation-mark 'x 'my-value (begin (f) (continuation-mark-set-first #f 'x))) produces anything other than 'my-value. Ev

Re: [racket] Continuation marks

2014-09-06 Thread John Clements
On Sep 5, 2014, at 2:24 PM, Gustavo Massaccesi wrote: > I'm trying to add a continuation mark inside a function, but I want > that the new mark to be visible after the functions returns. (Mostly > for curiosity, not an actual problem.) > > I want something like this: > > ;-- > #lang racket/bas

Re: [racket] Continuation marks

2014-09-06 Thread Gustavo Massaccesi
I agree that to get this output, using continuation marks is a bad idea. It'd be much better to use a parameter (or set!ing a global variable at a last resort). I'm trying to understand continuations marks. I'm reading some parts of the Racket compiler, and internally the functions have some flags