Re: [racket-users] defform quastion

2015-06-04 Thread Matthew Flatt
You can use `code:line` to group terms without parentheses:

 (code:line addition + term)


At Thu, 4 Jun 2015 16:53:33 +0200, "Jos Koot" wrote:
> Hi,
>  
> I have tried to use defform of scribble to describe the following:
>  
> syntax ($ infix-expr) → any
>  
> infix-expr ::= addition
>  
> addition   ::= term
> addition   ::= addition + term
> addition   ::= addition - term
>  
> term ::= etc.
>  
> Using #:grammar I can easily get:
>  
> addition = term
>| (addition + term)
>| (addition - term)
>  
> but I don't want the parentheses and I don't know how to get rid of them.
> Is it possible to generate something like:
>  
> infix-expr = addition
>  
> addition = term
>| addition + term
>| addition - term
> 
> If it is possible, help me please.
> Thanks, Jos
>  
>  
> 
> -- 
> 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] defform quastion

2015-06-04 Thread Jos Koot
Hi Mathhew,
Thanks very much.
I am sorry I did not see code:line by myself.
Jos 

-Original Message-
From: Matthew Flatt [mailto:mfl...@cs.utah.edu] 
Sent: jueves, 04 de junio de 2015 17:01
To: Jos Koot
Cc: 'Racket-Users List'
Subject: Re: [racket-users] defform quastion

You can use `code:line` to group terms without parentheses:

 (code:line addition + term)


At Thu, 4 Jun 2015 16:53:33 +0200, "Jos Koot" wrote:
> Hi,
>  
> I have tried to use defform of scribble to describe the following:
>  
> syntax ($ infix-expr) → any
>  
> infix-expr ::= addition
>  
> addition   ::= term
> addition   ::= addition + term
> addition   ::= addition - term
>  
> term ::= etc.
>  
> Using #:grammar I can easily get:
>  
> addition = term
>| (addition + term)
>| (addition - term)
>  
> but I don't want the parentheses and I don't know how to get rid of them.
> Is it possible to generate something like:
>  
> infix-expr = addition
>  
> addition = term
>| addition + term
>| addition - term
> 
> If it is possible, help me please.
> Thanks, Jos
>  
>  
> 
> -- 
> 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] defform quastion

2015-06-05 Thread Jos Koot
Hi

It took me more than hours to find the following for a #:grammar clause in
defform:

[ne-arglist arg (code:line ne-arglist @#,(litchar ",") arg)]

in order to produce

ne-arglist   =   arg
 |   ne-arglist , arg

It is abracadabra for me, but it works. I found it by trial and many errors.

It seems like unquote-syntax, but I don't see a quasiquote-syntax.

Surely I ought to read more docs on scribble, but where?

Thanks, Jos Koot


-Original Message-
From: Matthew Flatt [ <mailto:mfl...@cs.utah.edu> mailto:mfl...@cs.utah.edu]
Sent: jueves, 04 de junio de 2015 17:01
To: Jos Koot
Cc: 'Racket-Users List'
Subject: Re: [racket-users] defform quastion

You can use `code:line` to group terms without parentheses:

 (code:line addition + term)


At Thu, 4 Jun 2015 16:53:33 +0200, "Jos Koot" wrote:
> Hi,
> 
> I have tried to use defform of scribble to describe the following:
> 
> syntax ($ infix-expr) → any
> 
snip

-- 
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.