Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Sam Tobin-Hochstadt
On Fri, Feb 3, 2017 at 10:38 AM, Dupéron Georges wrote: > * I'm not 100% sure if #%stratified-body, #%plain-module-begin and > #%printing-module-begin can be overridden in a useful way or not. `#%stratified-body` is a way to get an older kind of internal definition

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Laurent
Thanks, that's very informative! On Fri, Feb 3, 2017 at 10:38 AM, Dupéron Georges < jahvascriptman...@gmail.com> wrote: > Le vendredi 3 février 2017 11:28:47 UTC+1, Laurent Orseau a écrit : > > I see. So basically all #% things are extension points? > > The list for the racket language: > > > >

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Dupéron Georges
Le vendredi 3 février 2017 11:28:47 UTC+1, Laurent Orseau a écrit : > I see. So basically all #% things are extension points? > The list for the racket language: > > http://docs.racket-lang.org/search/index.html?q=%23%25%20L%3Aracket  I think #% just means "low-level". * #%declare,

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Laurent
I see. So basically all #% things are extension points? The list for the racket language: http://docs.racket-lang.org/search/index.html?q=%23%25%20L%3Aracket On Fri, Feb 3, 2017 at 10:04 AM, Dupéron Georges < jahvascriptman...@gmail.com> wrote: > Le vendredi 3 février 2017 10:56:10 UTC+1,

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Dupéron Georges
Le vendredi 3 février 2017 10:56:10 UTC+1, Laurent Orseau a écrit : > Btw, with "Macro Hiding: Disabled" we can see that after foo is turned into > #'1 (printed '1' in the macro stepper), then the 1 is 'tagged' with (#%datum > . 1) and then right after that turned into (quote 1). Is the tagging

Re: [racket-users] Confused about syntax properties

2017-02-03 Thread Laurent
Very nice example, thanks Georges. Btw, with "Macro Hiding: Disabled" we can see that after foo is turned into #'1 (printed '1' in the macro stepper), then the 1 is 'tagged' with (#%datum . 1) and then right after that turned into (quote 1). Is the tagging step necessary for numbers? On Fri,

Re: [racket-users] Confused about syntax properties

2017-02-02 Thread Dupéron Georges
PS: a nice example to try in the macro stepper, to see the evaluation order: #lang racket (define-syntax (foo stx) #'1) (define-syntax (bar stx) #'foo) (let () bar (let () bar (let () bar bar) (#%expression bar) bar) (+ bar bar) bar) -- You received this

Re: [racket-users] Confused about syntax properties

2017-02-02 Thread Dupéron Georges
Le lundi 30 janvier 2017 06:25:29 UTC+1, Matias Eyzaguirre a écrit : > Nice, thanks! I wasn’t aware of that. so macros are expanded in the order > that the reader reads them, not in so called evaluation order. >From experience, the order is outside-in, each form after the preceding one >(except

Re: [racket-users] Confused about syntax properties

2017-01-29 Thread Matias Eyzaguirre
> On 29 Jan 2017, at 11:21, Ben Greenman wrote: > > The third result is #f because in the third example, stx is `(annotate > (annotate 4 2))`. So the first pattern matches and `val` is the syntax > `(annotate 4 2)`. > > You can get a "strict" evaluation order by

Re: [racket-users] Confused about syntax properties

2017-01-29 Thread 'William J. Bowman' via Racket Users
On Sun, Jan 29, 2017 at 10:06:30AM -0800, Matias Eyzaguirre wrote: > Hullo all, > > I'm messing around with syntax properties to try to get a feel for them, but > in one of my tests they aren't behaving the way I would expect them to. > > In my example the output is #f 1 #f, when I would have

Re: [racket-users] Confused about syntax properties

2017-01-29 Thread Ben Greenman
The third result is #f because in the third example, stx is `(annotate (annotate 4 2))`. So the first pattern matches and `val` is the syntax `(annotate 4 2)`. You can get a "strict" evaluation order by using `local-expand` inside the `annotate` macro. For example: #lang racket (define-syntax

[racket-users] Confused about syntax properties

2017-01-29 Thread Matias Eyzaguirre
Hullo all, I'm messing around with syntax properties to try to get a feel for them, but in one of my tests they aren't behaving the way I would expect them to. In my example the output is #f 1 #f, when I would have thought it would be #f 1 2. Why is the third result #f and not 2? #lang