Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi Justin, thanks for reply and the code! :) Cheers Meino Justin Zamora [16-11-17 04:02]: > I think you are looking for something like this: > > #lang racket > > (require test-engine/racket-tests) > > (define (remove-empty-lists lst) > (cond > [(null? lst) '()] ;

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 08:24 PM, Dan Liebgold wrote: FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro that is used extensively inside TR. https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt Hmm... I can't quite

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 07:51 PM, Vincent St-Amour wrote: FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro that is used extensively inside TR. https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt Its companion

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 07:42 PM, Dan Liebgold wrote: Literal sets can include datum-literals: (define-literal-set lits #:datum-literals (a b c) (d e)) Ah, oops I missed that keyword parameter. For question 1, that's probably the best way. If you want to suppress the printing of all of the

Re: [racket-users] If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-16 Thread David Storrs
Ah, I should have thought of that. Yep, it works. Thanks. On Wed, Nov 16, 2016 at 5:12 PM, Greg Hendershott wrote: > racket-mode is on MELPA: > > https://melpa.org/#/racket-mode > > But not MELPA stable. > > Personally I use only MELPA non-stable, because I like

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Justin Zamora
I think you are looking for something like this: #lang racket (require test-engine/racket-tests) (define (remove-empty-lists lst) (cond [(null? lst) '()] ; Check for end of list [(null? (first lst)) (remove-empty-lists (rest lst))] ; Skip null sublist [(not (list? (first lst))) ;

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro > that is used extensively inside TR. > > > https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt > Hmm... I can't quite figure that one out. Maybe with some

Re: [racket-users] If a thunk is a proc of zero arguments, what is a proc of one argument?

2016-11-16 Thread Greg Hendershott
racket-mode is on MELPA: https://melpa.org/#/racket-mode But not MELPA stable. Personally I use only MELPA non-stable, because I like packages to break all the time. Seriously, it's been fine, for me. In Emacs 24.4+ I understand it's possible to use both. You can say to get certain packages

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Vincent St-Amour
FWIW, Eric Dobson wrote a very nice `define-literal-syntax-class` macro that is used extensively inside TR. https://github.com/racket/typed-racket/blob/master/typed-racket-lib/typed-racket/utils/literal-syntax-class.rkt Its companion `define-merged-syntax-class` is quite nice too.

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
> > Literal sets can include datum-literals: > >(define-literal-set lits #:datum-literals (a b c) (d e)) > Ah, oops I missed that keyword parameter. > For question 1, that's probably the best way. If you want to suppress > the printing of all of the datum literals in error messages, you

Re: [racket-users] syntax-class composed of literals

2016-11-16 Thread Ryan Culpepper
On 11/16/2016 06:11 PM, Dan Liebgold wrote: Hi, A couple questions about literals in syntax-parse: 1. I'd like to make a syntax-class that is just a set of literals (with a clear error for something not matching any literal). Is there a better way than this: http://pasterack.org/pastes/86722

[racket-users] syntax-class composed of literals

2016-11-16 Thread Dan Liebgold
Hi, A couple questions about literals in syntax-parse: 1. I'd like to make a syntax-class that is just a set of literals (with a clear error for something not matching any literal). Is there a better way than this: http://pasterack.org/pastes/86722 I need to ignore the bindings for those

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi David, thanks for the reply and the link! :) I have a list of sublist, which I want to process recursively. Some sublists are empty, some are filled. The typical pattern is (as far as I know) (define (process-list lst) (cons (do-somthing-with-sublist (car lst)) (process-lst (car

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread David Storrs
On Wed, Nov 16, 2016 at 11:10 AM, David Storrs wrote: > Hi Meino, > > As a suggestions, you might want to read through this page on Stack > Overflow about how to ask technical questions: > http://stackoverflow.com/help/how-to-ask The summary is: tell us what > you're

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread David Storrs
Hi Meino, As a suggestions, you might want to read through this page on Stack Overflow about how to ask technical questions: http://stackoverflow.com/help/how-to-ask The summary is: tell us what you're trying to achieve, what you've tried, and what *specifically* is not working. The question

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Matthias Felleisen
> On Nov 16, 2016, at 1:04 PM, meino.cra...@gmx.de wrote: > > ...no, not a homework... > I want to teach myself some racket and hope 'to get it' finally... > Since I am no native speaker I have the deficulty to search for > things, which names I dont know... Meino, have you considered reading

Re: [racket-users] Recursevly processing a list with "wholes"

2016-11-16 Thread Meino . Cramer
Hi John, thank you for your reply ! :) ...no, not a homework... I want to teach myself some racket and hope 'to get it' finally... Since I am no native speaker I have the deficulty to search for things, which names I dont know... One example of my code is: (define (trim-list lst) (if (empty?

Re: [racket-users] a litle help

2016-11-16 Thread Gustavo Massaccesi
The program has a few errors. For example, * (define O ( X0 Y0 )) should be something like (define O (make-point X0 Y0)) (define O (point X0 Y0)) (define O (vector X0 Y0)) I'm not sure because the first two don't exist and I guess the last one is not what you want, but you

[racket-users] a litle help

2016-11-16 Thread Masto Fine
(define (ballon-tourne) (local [(define LARG 110 ) (define HAUT 110 ) (define SCENE (carre 100 100 'outline "black")) (define BALLON ( circle 5 'solid "red")) (define X0 (/ LARG 2)) (define Y0 (/ HAUT 2 )) (define O ( X0