[racket] users Digest, Vol 109, Issue 56

From: Moshe Deutsch (moshedeutsch115 at gmail.com)
Date: Mon Sep 29 16:43:54 EDT 2014

Please take me off the list

Thanks

On Thu, Sep 25, 2014 at 12:00 PM,  <users-request at racket-lang.org> wrote:
> Send users mailing list submissions to
>         users at racket-lang.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         http://lists.racket-lang.org/users/listinfo
> or, via email, send a message with subject or body 'help' to
>         users-request at racket-lang.org
>
> You can reach the person managing the list at
>         users-owner at racket-lang.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of users digest..."
>
>
> [Racket Users list:
>  http://lists.racket-lang.org/users ]
>
>
> Today's Topics:
>
>    1.  Unquoting a variable without unquoting its contents? (J Arcane)
>    2. Re: macro question (Jay McCarthy)
>    3. Re: macro question (Alejandro Zamora)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Thu, 25 Sep 2014 16:52:47 +0300
> From: J Arcane <jarcane at gmail.com>
> To: Racket Users <users at racket-lang.org>
> Subject: [racket]  Unquoting a variable without unquoting its
>         contents?
> Message-ID:
>         <CA+HVF0Ddf_WybAgJAAnJBvYeVoYMXhcN=4Kp4YF1_v-a9TSwGg at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> http://try-racket.org continues to splutter to life, but there's still
> something of a glaring error in that it doesn't really like list or quote
> at all.
>
> AlexKnauth has narrowed the problem down here:
> https://github.com/jarcane/try-racket/issues/4#issuecomment-56751603
>
> It seems that unquoting a variable does funny things to the variable's
> contents when they contain a bare quoted list or symbol, so we get weird
> results and errors. Quotes get lost, and then the eval finds itself looking
> at mangled forms.
>
> The best I can think of to do is maybe make a simple macro rather than
> using quasiquote? Any ideas?
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <http://lists.racket-lang.org/users/archive/attachments/20140925/e97f0d3f/attachment-0001.html>
>
> ------------------------------
>
> Message: 2
> Date: Thu, 25 Sep 2014 10:17:49 -0400
> From: Jay McCarthy <jay.mccarthy at gmail.com>
> To: Alejandro Zamora <terefv at ltu.sld.cu>
> Cc: Racket Users <users at racket-lang.org>
> Subject: Re: [racket] macro question
> Message-ID:
>         <CAJYbDakR7Sxa55rRiZoFinREGEdZyT7V4d+QRD0f_G1CA4j-GA at mail.gmail.com>
> Content-Type: text/plain; charset=UTF-8
>
> I won't answer the question about R5RS, but in Racket you can do this
> fairly succinctly:
>
> #lang racket/base
> (require (for-syntax racket/base
>                      racket/syntax))
>
> (define-syntax (vars stx)
>   (syntax-case stx ()
>     [(_ id count val)
>      (with-syntax
>          ([(id_i ...)
>            (for/list ([i (in-range 1 (add1 (syntax->datum #'count)))])
>              (format-id #'id "~a~a" #'id i))])
>      (syntax/loc stx
>        (begin (define id_i val)
>               ...)))]))
>
> (vars id 5 null)
>
> (vector id1 id2 id3 id4 id5)
>
> 2014-09-24 22:35 GMT-04:00 Alejandro Zamora <terefv at ltu.sld.cu>:
>> Hi Racket people:
>>         I have a (maybe too simple) question:
>>         How I create one macro like this (but using define-macro &
>>         R5RS language only)?:
>>
>>         (vars sym var-cant val-of-vars)
>>
>>         Example:
>>         (vars id 5 null) -> (prog (define id1 null)
>>                                   (define id2 null)
>>                                   (define id3 null)
>>                                   (define id4 null)
>>                                   (define id5 null))
>>
>> --
>> Nunca digas nunca, di mejor: gracias, permiso, disculpe.
>>
>> Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas
>>
>> Infomed: http://www.sld.cu/
>>
>> ____________________
>>   Racket Users list:
>>   http://lists.racket-lang.org/users
>
>
>
> --
> Jay McCarthy
> http://jeapostrophe.github.io
>
>            "Wherefore, be not weary in well-doing,
>       for ye are laying the foundation of a great work.
> And out of small things proceedeth that which is great."
>                           - D&C 64:33
>
>
>
> ------------------------------
>
> Message: 3
> Date: Thu, 25 Sep 2014 10:49:15 -0400
> From: Alejandro Zamora <terefv at ltu.sld.cu>
> To: Jay McCarthy <jay.mccarthy at gmail.com>
> Cc: Racket Users <users at racket-lang.org>
> Subject: Re: [racket] macro question
> Message-ID: <20140925104915.59291dc0 at alejandro-H61H2-CM>
> Content-Type: text/plain; charset=UTF-8
>
> Thanks Jay!!
> nice solution!!
> I'm asking for define-macro & R5RS because I'm trying to use one
> R5RS Embedded Scheme Interpreter on Python that have only define-macro
> construction for make macros and I want to use it.
>
> greetings!
>
>  El Thu, 25 Sep 2014 10:17:49 -0400
> Jay McCarthy <jay.mccarthy at gmail.com> escribi?:
>> I won't answer the question about R5RS, but in Racket you can do this
>> fairly succinctly:
>>
>> #lang racket/base
>> (require (for-syntax racket/base
>>                      racket/syntax))
>>
>> (define-syntax (vars stx)
>>   (syntax-case stx ()
>>     [(_ id count val)
>>      (with-syntax
>>          ([(id_i ...)
>>            (for/list ([i (in-range 1 (add1 (syntax->datum #'count)))])
>>              (format-id #'id "~a~a" #'id i))])
>>      (syntax/loc stx
>>        (begin (define id_i val)
>>               ...)))]))
>>
>> (vars id 5 null)
>>
>> (vector id1 id2 id3 id4 id5)
>>
>> 2014-09-24 22:35 GMT-04:00 Alejandro Zamora <terefv at ltu.sld.cu>:
>> > Hi Racket people:
>> >         I have a (maybe too simple) question:
>> >         How I create one macro like this (but using define-macro &
>> >         R5RS language only)?:
>> >
>> >         (vars sym var-cant val-of-vars)
>> >
>> >         Example:
>> >         (vars id 5 null) -> (prog (define id1 null)
>> >                                   (define id2 null)
>> >                                   (define id3 null)
>> >                                   (define id4 null)
>> >                                   (define id5 null))
>> >
>> > --
>> > Nunca digas nunca, di mejor: gracias, permiso, disculpe.
>> >
>> > Este mensaje le ha llegado mediante el servicio de correo
>> > electronico que ofrece Infomed para respaldar el cumplimiento de
>> > las misiones del Sistema Nacional de Salud. La persona que envia
>> > este correo asume el compromiso de usar el servicio a tales fines y
>> > cumplir con las regulaciones establecidas
>> >
>> > Infomed: http://www.sld.cu/
>> >
>> > ____________________
>> >   Racket Users list:
>> >   http://lists.racket-lang.org/users
>>
>>
>>
>
>
> --
> Nunca digas nunca, di mejor: gracias, permiso, disculpe.
>
> Este mensaje le ha llegado mediante el servicio de correo electronico que ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema Nacional de Salud. La persona que envia este correo asume el compromiso de usar el servicio a tales fines y cumplir con las regulaciones establecidas
>
> Infomed: http://www.sld.cu/
>
>
>
>
> End of users Digest, Vol 109, Issue 56
> **************************************


Posted on the users mailing list.