Re: [racket-users] macro guard question (ellipsis)

2019-06-18 Thread Sorawee Porncharoenwase
Also note that with syntax/parse, it becomes much easier:

(require (for-syntax syntax/parse))

(define-syntax (foo stx)
  (syntax-parse stx
[(_ (key:id val:id ...) ...)
 #'(quote (list ((quote key) (quote val) ...) ...))]))


On Tue, Jun 18, 2019 at 8:56 PM Sorawee Porncharoenwase <
sorawee.pw...@gmail.com> wrote:

> I’d write this. Not sure if there’s a better way.
>
> (define-syntax (foo stx)
>   (syntax-case stx ()
> [(_ (key val ...) ...)
>  (andmap identifier? (syntax->list #'(key ... {~@ val ...} ...)))
>  #'(quote (list ((quote key) (quote val) ...) ...))]))
>
>
> On Tue, Jun 18, 2019 at 8:11 PM Kevin Forchione  wrote:
>
>> Hi guys,
>> I’ve been trying to figure out the syntax for a guard when the pattern
>> has ellipsis and you want to guard one of the variables. Here’s an
>> uninteresting macro but it shows what I mean.
>>
>> #lang racket
>>
>> (define-syntax (foo stx)
>>   (syntax-case stx ()
>> [(_ (key val ...) ...)
>>  (and (identifier? #'key) (identifier? #'val))
>>  #'(quote (list ((quote key) (quote val) ...) ...))]))
>>
>> (foo (a b) (c d e))
>>
>> Of course it complains about the ellipsis being missing in the pattern.
>> Is this something I can handle with a guard in this manner or do I need a
>> helper macro of some sort?
>>
>> Thanks!
>> Kevin
>>
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/D76D1CBC-BF78-493F-89B9-9498D615A5E7%40gmail.com
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegu-g0rHDJWrhM9%2BkFhLsc9k0ztvj3OoO0Fe5w%2Bk6MmFqQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] macro guard question (ellipsis)

2019-06-18 Thread Sorawee Porncharoenwase
I’d write this. Not sure if there’s a better way.

(define-syntax (foo stx)
  (syntax-case stx ()
[(_ (key val ...) ...)
 (andmap identifier? (syntax->list #'(key ... {~@ val ...} ...)))
 #'(quote (list ((quote key) (quote val) ...) ...))]))


On Tue, Jun 18, 2019 at 8:11 PM Kevin Forchione  wrote:

> Hi guys,
> I’ve been trying to figure out the syntax for a guard when the pattern has
> ellipsis and you want to guard one of the variables. Here’s an
> uninteresting macro but it shows what I mean.
>
> #lang racket
>
> (define-syntax (foo stx)
>   (syntax-case stx ()
> [(_ (key val ...) ...)
>  (and (identifier? #'key) (identifier? #'val))
>  #'(quote (list ((quote key) (quote val) ...) ...))]))
>
> (foo (a b) (c d e))
>
> Of course it complains about the ellipsis being missing in the pattern. Is
> this something I can handle with a guard in this manner or do I need a
> helper macro of some sort?
>
> Thanks!
> Kevin
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/D76D1CBC-BF78-493F-89B9-9498D615A5E7%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CADcuegtJUgVOOEm%3DS1qKmVqiviCqMYb6gudfjU_QfUzTSw5sZw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] macro guard question (ellipsis)

2019-06-18 Thread Kevin Forchione
Hi guys,
I’ve been trying to figure out the syntax for a guard when the pattern has 
ellipsis and you want to guard one of the variables. Here’s an uninteresting 
macro but it shows what I mean.

#lang racket

(define-syntax (foo stx)
  (syntax-case stx ()
[(_ (key val ...) ...)
 (and (identifier? #'key) (identifier? #'val))
 #'(quote (list ((quote key) (quote val) ...) ...))]))

(foo (a b) (c d e))

Of course it complains about the ellipsis being missing in the pattern. Is this 
something I can handle with a guard in this manner or do I need a helper macro 
of some sort? 

Thanks!
Kevin


-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/D76D1CBC-BF78-493F-89B9-9498D615A5E7%40gmail.com.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Call for Participation: Summer BOB 2019 (August 21, Berlin)

2019-06-18 Thread Michael Sperber



   Summer BOB 2019
  Conference
 “What happens if we simply use what’s best?”
   August 21, 2019, Berlin
   co-located with ICFP 2019
http://bobkonf.de/2019-summer/
 Program: http://bobkonf.de/2019-summer/program.html
Registration: http://bobkonf.de/2019-summer/registration.html


Are you interested in technologies beyond the mainstream, that are a
pleasure to use, and effective at getting the job done?

BOB is the forum for developers, architects and builders to explore
and discover the best tools available today for building software. Our
goal is for all participants to leave the conference with new ideas to
improve development back at the ranch.

Summer BOB is a one-time-only event, in the spirit of the spectacular
Winter BOB. The International Conference on Functional Programming is
coming to town, and Summer BOB will be right in the middle of it, on
the last day of ICFP proper, prior to all the workshops. Summer BOB
will feature two tracks: one from practitioners, and one from
researchers, and foster communication and cross-pollination between
these communities.

BOB features two tracks of seven talk each: One research track with
invited talks, and one track by practitioners, designed to
cross-pollinate and inspire.

http://bobkonf.de/2019-summer/program.html

Topics include distributed programming, testing, linear algebra,
functional design patterns, type systems, formal methods, and
interactive development.

We are committed to diversity: We aim at exploring a wide range of
tools in a welcoming and friendly crowd of diverse people. To that
end, a number of support options for participants from groups
under-represented in tech are available.

http://bobkonf.de/2019-summer/registration.html

NOTE: The early-bird rates expire on July 18, 2019!

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/y9l7e9jz6g5.fsf%40deinprogramm.de.
For more options, visit https://groups.google.com/d/optout.