[racket-users] syntax-parse attributes in macro-generated macros

2017-09-16 Thread Philip McGrath
Hi everyone,

I'm writing a macro-generating macro where the generated macro uses
`syntax-parse`, and I can't figure out how to work with attributes using
the dot syntax where the base identifier is generated by the outer macro.

For example, consider the following macro:

(define-syntax example-macro
  (syntax-parser
[(_ (~alt (~optional (~seq #:a (~var a
 (expr/c #'symbol?)))
 #:defaults ([a.c #''default-a]))
  (~optional (~seq #:b (~var b
 (expr/c #'string?)))
 #:defaults ([b.c #'"default-b"])))
...)
 #`(list a.c b.c)]))

I have a macro like `example-macro`, but more complicated and with many,
many more potential keyword arguments, so I wanted to write a macro that
would let me define `example-macro` with a more declarative syntax, like
this:

(define-example-macro/working generated-example-macro
  [#:a 'default-a symbol?]
  [#:b "default-b" string?])

My initial attempt looked something like this:

(define-syntax (define-example-macro/buggy stx)
  (define-syntax-class arg-clause
(pattern [kw:keyword default:expr contract:expr]))
  (syntax-parse stx
[(_ name clause:arg-clause ...+)
 ;#:with (arg ...) (generate-temporaries #'(clause.kw ...))
 ;#:with (arg.c ...) (generate-temporaries #'(clause.kw ...))
 #`(define-syntax name
 (syntax-parser
   [(_ (~alt (~optional
  (~seq clause.kw (~var arg (expr/c #'clause.contract)))
  #:defaults ([arg.c #'clause.default]))
 ...)
   (... ...))
#`(list arg.c ...)]))]))

which raises a syntax error "syntax: no pattern variables before ellipsis
in template".

The problem seems to be that `arg.c` is not recognized as a pattern
variable derived from `arg`. I tried several variants on this, none of
which allowed me to refer to `arg.c`. For example, if I uncomment the two
`#:with` lines, I get the error "~optional: attribute bound in defaults but
not in pattern".

I eventually figured out a tricky way to avoid using dotted attributes
altogether (see below), but it's rather less elegant than the non-working
way. I am hoping there is a way to generate the right identifier for
`arg.c` somehow.

Thanks,
Philip

(define-syntax (define-example-macro/working stx)
  (define-syntax-class arg-clause
(pattern [kw:keyword default:expr contract:expr]
 #:with arg (generate-temporary #'kw)
 ))
  (syntax-parse stx
[(_ name clause:arg-clause ...+)
 #:with add-contract (generate-temporary 'add-contract)
 #:with (unsyntax-arg.c ...)
 #`(#,@(for/list ([arg-stx (in-list (syntax-e #'(clause.arg ...)))]
  [contract-stx (in-list (syntax-e #'(clause.contract
...)))])
 (with-syntax ([arg arg-stx]
   [contract contract-stx])
   #'#,(add-contract #'arg #'contract
 #`(define-syntax (name inner-stx)
 (define (add-contract arg-stx contract-stx [err-name "name goes
here"])
   (syntax-parse arg-stx
 [the-arg
  #:declare the-arg (expr/c contract-stx
#:name err-name
#:macro #'name)
  #'the-arg.c]))
 (syntax-parse inner-stx
   [(_ (~alt (~optional
  (~seq clause.kw clause.arg)
  #:defaults ([clause.arg #'clause.default]))
 ...)
   (... ...))
#`(list unsyntax-arg.c ...)]))]))

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racketeers and slide-show presentations

2017-09-16 Thread Andrew Gwozdziewycz
I've been hacking on a way to make *simpler* slideshow presentations, which 
I'll actually present briefly at Racketcon next month. The idea is to take 
something plaintext and turn it into slides, so you don't have to be a pict 
master. I am trying to work in how to include slides that are Picts, but it's 
still a bit early.

Naturally, the resultant slideshows are slideshow (the tool) compatible, and as 
a result, allow for speakers notes and handouts to be included. I hope to have 
a lot more posted next week, but the start of what I'm talking about is at:

https://github.com/apg/slideshow-simple

Not sure if that meets your needs yet, but hopefully it will soon.

> On Sep 16, 2017, at 08:06, Robby Findler  wrote:
> 
> In that case, it probably makes sense for you to use scribble to
> replace the LaTeX part of your workflow from the past. Specifically,
> if you've got a pict, you can just drop it into anywhere you would
> have put text in a scribble document and the right thing will happen.
> So hopefully this'll improve your workflow a little bit.
> 
> Robby
> 
> 
>> On Sat, Sep 16, 2017 at 9:47 AM, Daniel Brunner  wrote:
>> Hello,
>> 
>> when I used LaTeX/beamer I used beamer solely for the slides and
>> produced a seperate handout with LaTeX.
>> 
>> I switched to slideshow/pict recently but it takes a lot of time for me
>> to prepare the presentation due to my missing skills in using pict.
>> 
>> Best wishes,
>> Daniel
>> 
>>> Am 16.09.2017 um 16:08 schrieb Matthias Felleisen:
>>> 
>>> When you watch the presentations of people who present with latex/beamer,
>>> you notice that most just excerpt the paper. This reduces the amount of time
>>> needed to prepare the presentation and the quality of the presentation at 
>>> the
>>> same time. A paper/handout and a presentation are two completely different
>>> ways of bringing across intuition and if you connect them, you miss a 
>>> chance.
>>> 
>>> In this sense, you’re at an advantage with scribble and slideshow -) The bit
>>> of disconnect forces you to rethink the presentation. Pict is a bit of a 
>>> connection
>>> between the two.
>>> 
>>> Note of caution
>>> 
>>> — my use of scribble is restricted to a few papers with PhD students
>>>  and How to Design Programs/2e.
>>> 
>>> — I do not use slideshow only pict.
>>> 
>>> 
>>> 
>>> 
>>> 
 On Sep 16, 2017, at 9:40 AM, Gour  wrote:
 
 Hello!
 
 Racket language is deeply rooted in academia and used wildly in
 education, so, I hope, it's reasonable that Racketeers are often
 preparing slide-show presentations...
 
 In order to take an advantage of Racket's ecosystem I'd like to use it for 
 such
 purpose and slide-show package is natural choice, but  wonder how do
 Racketeers prepare speaker notes and/or handouts papers for their
 preparations?
 Got some info in #racket yesterday, but believe there must be some
 further info/ideas available?
 
 Having experience with LaTeX/Beamer I'd expect to have some integrated
 solution, but my browsing of slide-show & scribble docs hasn't yielded
 adequate information,
 
 Any hint?
 
 
 Sincerely,
 Gour
 
 --
 Abandoning all attachment to the results of his activities,
 ever satisfied and independent, he performs no fruitive action,
 although engaged in all kinds of undertakings.
 
 
 --
 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.
 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.
>> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] (racketcon 2017) Is there a shuttle from the hotel?

2017-09-16 Thread David Storrs
You might take a look on AirBnB.  I'm staying at a place that's much closer
than the main hotel, and also about 1/6 the price.

On Sat, Sep 16, 2017 at 11:58 AM, Leif Andersen 
wrote:

> Okay thanks.
>
> For future reference, that is actually a very long distance for many
> people in wheelchairs.
>
> Do you know if there are any hotels closer to the conference venue?
>
> ~Leif Andersen
>
>
> On Mon, Sep 11, 2017 at 8:53 PM, Vincent St-Amour
>  wrote:
> > Google maps predicts 14 minutes.
> >
> > https://www.google.com/maps/dir/Hotel+Deca,+4507+Brooklyn+
> Ave+NE,+Seattle,+WA+98105/Mary+Gates+Hall,+1851+NE+
> Grant+Ln,+Seattle,+WA+98105/@47.6582455,-122.3156366,16z/
> data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x5490148ac590c9fd:
> 0x5ca09aa87f1f39cd!2m2!1d-122.3145465!2d47.6615196!1m5!1m1!
> 1s0x549014f2ab81c35f:0x6dda64382ddc87a4!2m2!1d-122.
> 3079505!2d47.6549716!3e2
> >
> > Vincent
> >
> >
> > On Mon, 11 Sep 2017 17:33:20 -0500,
> > Leif Andersen wrote:
> >>
> >> How short of a walk?
> >>
> >> I ask because there is about a 30% chance my partner (who is wheel
> >> chair bound) will be going.
> >>
> >> ~Leif Andersen
> >>
> >>
> >> On Mon, Sep 11, 2017 at 2:19 PM, Vincent St-Amour
> >>  wrote:
> >> > Hi Dave,
> >> >
> >> > We're not planning a shuttle; the hotel is a short walk from the
> venue.
> >> >
> >> > If that's an issue for you, please do let us know.
> >> >
> >> > Vincent
> >> >
> >> >
> >> >
> >> > On Mon, 11 Sep 2017 10:35:02 -0500,
> >> > David Storrs wrote:
> >> >>
> >> >> Hi folks,
> >> >>
> >> >> Is there a shuttle from the hotel to the venue and, if so, what
> times does it run?
> >> >>
> >> >> Dave
> >> >>
> >> >> --
> >> >> 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.
> >> >> 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.
> >> > 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.
> >> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] (racketcon 2017) Is there a shuttle from the hotel?

2017-09-16 Thread Leif Andersen
Okay thanks.

For future reference, that is actually a very long distance for many
people in wheelchairs.

Do you know if there are any hotels closer to the conference venue?

~Leif Andersen


On Mon, Sep 11, 2017 at 8:53 PM, Vincent St-Amour
 wrote:
> Google maps predicts 14 minutes.
>
> https://www.google.com/maps/dir/Hotel+Deca,+4507+Brooklyn+Ave+NE,+Seattle,+WA+98105/Mary+Gates+Hall,+1851+NE+Grant+Ln,+Seattle,+WA+98105/@47.6582455,-122.3156366,16z/data=!3m1!4b1!4m14!4m13!1m5!1m1!1s0x5490148ac590c9fd:0x5ca09aa87f1f39cd!2m2!1d-122.3145465!2d47.6615196!1m5!1m1!1s0x549014f2ab81c35f:0x6dda64382ddc87a4!2m2!1d-122.3079505!2d47.6549716!3e2
>
> Vincent
>
>
> On Mon, 11 Sep 2017 17:33:20 -0500,
> Leif Andersen wrote:
>>
>> How short of a walk?
>>
>> I ask because there is about a 30% chance my partner (who is wheel
>> chair bound) will be going.
>>
>> ~Leif Andersen
>>
>>
>> On Mon, Sep 11, 2017 at 2:19 PM, Vincent St-Amour
>>  wrote:
>> > Hi Dave,
>> >
>> > We're not planning a shuttle; the hotel is a short walk from the venue.
>> >
>> > If that's an issue for you, please do let us know.
>> >
>> > Vincent
>> >
>> >
>> >
>> > On Mon, 11 Sep 2017 10:35:02 -0500,
>> > David Storrs wrote:
>> >>
>> >> Hi folks,
>> >>
>> >> Is there a shuttle from the hotel to the venue and, if so, what times 
>> >> does it run?
>> >>
>> >> Dave
>> >>
>> >> --
>> >> 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.
>> >> 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.
>> > 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.
>> 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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racketeers and slide-show presentations

2017-09-16 Thread Robby Findler
In that case, it probably makes sense for you to use scribble to
replace the LaTeX part of your workflow from the past. Specifically,
if you've got a pict, you can just drop it into anywhere you would
have put text in a scribble document and the right thing will happen.
So hopefully this'll improve your workflow a little bit.

Robby


On Sat, Sep 16, 2017 at 9:47 AM, Daniel Brunner  wrote:
> Hello,
>
> when I used LaTeX/beamer I used beamer solely for the slides and
> produced a seperate handout with LaTeX.
>
> I switched to slideshow/pict recently but it takes a lot of time for me
> to prepare the presentation due to my missing skills in using pict.
>
> Best wishes,
> Daniel
>
> Am 16.09.2017 um 16:08 schrieb Matthias Felleisen:
>>
>> When you watch the presentations of people who present with latex/beamer,
>> you notice that most just excerpt the paper. This reduces the amount of time
>> needed to prepare the presentation and the quality of the presentation at the
>> same time. A paper/handout and a presentation are two completely different
>> ways of bringing across intuition and if you connect them, you miss a chance.
>>
>> In this sense, you’re at an advantage with scribble and slideshow -) The bit
>> of disconnect forces you to rethink the presentation. Pict is a bit of a 
>> connection
>> between the two.
>>
>> Note of caution
>>
>>  — my use of scribble is restricted to a few papers with PhD students
>>   and How to Design Programs/2e.
>>
>>  — I do not use slideshow only pict.
>>
>>
>>
>>
>>
>>> On Sep 16, 2017, at 9:40 AM, Gour  wrote:
>>>
>>> Hello!
>>>
>>> Racket language is deeply rooted in academia and used wildly in
>>> education, so, I hope, it's reasonable that Racketeers are often
>>> preparing slide-show presentations...
>>>
>>> In order to take an advantage of Racket's ecosystem I'd like to use it for 
>>> such
>>> purpose and slide-show package is natural choice, but  wonder how do
>>> Racketeers prepare speaker notes and/or handouts papers for their
>>> preparations?
>>> Got some info in #racket yesterday, but believe there must be some
>>> further info/ideas available?
>>>
>>> Having experience with LaTeX/Beamer I'd expect to have some integrated
>>> solution, but my browsing of slide-show & scribble docs hasn't yielded
>>> adequate information,
>>>
>>> Any hint?
>>>
>>>
>>> Sincerely,
>>> Gour
>>>
>>> --
>>> Abandoning all attachment to the results of his activities,
>>> ever satisfied and independent, he performs no fruitive action,
>>> although engaged in all kinds of undertakings.
>>>
>>>
>>> --
>>> 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.
>>> 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.
> 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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Racketeers and slide-show presentations

2017-09-16 Thread Gour
Hello!

Racket language is deeply rooted in academia and used wildly in
education, so, I hope, it's reasonable that Racketeers are often
preparing slide-show presentations...

In order to take an advantage of Racket's ecosystem I'd like to use it for such
purpose and slide-show package is natural choice, but  wonder how do
Racketeers prepare speaker notes and/or handouts papers for their
preparations? 
Got some info in #racket yesterday, but believe there must be some
further info/ideas available?

Having experience with LaTeX/Beamer I'd expect to have some integrated
solution, but my browsing of slide-show & scribble docs hasn't yielded
adequate information,

Any hint?


Sincerely,
Gour

-- 
Abandoning all attachment to the results of his activities,
ever satisfied and independent, he performs no fruitive action,
although engaged in all kinds of undertakings.


-- 
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Re: Strange gray lines in DrRacket editor

2017-09-16 Thread Luis Sanjuán
Hi, Jaroslaw

Something you could try/investigate is scaling per app on Windows. It seems 
that last Windows releases allow something along those lines. I cannot verify 
it, though:

http://news.kynosarges.org/2017/04/16/dpi-settings-in-windows-10-creators-update/

Another workaround that some users on Unix systems may find helpful and doesn't 
involve changing display resolutions, or dealing with xrandr, or something like 
that is to set text scaling as they like for everything in the Desktop 
Environment, but make DrRacket override that setting when running via the 
environment variable PLT_DISPLAY_BACKING_SCALE set to 1. This actually reverts 
the general dpi setting and so fixes artifacts:

https://docs.racket-lang.org/gui/windowing-overview.html#%28part._display-resolution%29

-- 
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.
For more options, visit https://groups.google.com/d/optout.