Egil Moller also mentioned the following syntax:

'
...' x y

(where the initial . are spaces)

Unfortunately this is not supported by the currently defined parser above
for i-expr.

possibly:

(i-expr lvl) -> QUOTE eol-empty-lines (body inlvl), if (> inlvl lvl)
  (cons 'quote $3)

... with corresponding additions for QUASIQUOTE et al.  Note the following:

...'
.x

=> yields (quote), empty body (and a syntax error caught by the quote
special form)

'
..'
....x

=> yields (quote (quote x)), which I think should be what we expect.

'
..x
..y

=> yields (quote x y), which, while wrong, is still what I expect.  It's
not clear from this alone what it should mean.

Still, should this last case yield (quote (x y)) instead?  Does that make
more sense?  In that case our modification should be:

(i-expr lvl) -> QUOTE eol-empty-lines (body inlvl), if (> inlvl lvl)
  (if (<= (length $3) 1)
      (cons 'quote $3)
      (list 'quote $3))

But I don't like this.  Compare:

'
..x y
=> (quote (x y))
'
..x
..y
=> (quote (x y))

with this:

foo
  x y
=> (foo (x y))
foo
  x
  y
=> (foo x y)

This seems to privelege QUOTE et al. too much.  Or should they indeed be
priveleged?

On Sat, Jun 30, 2012 at 3:19 AM, Alan Manuel Gloria <[email protected]>wrote:

> Sigh.  Let me redo mdn-expr
>
> any-space -> SPACE | TAB | VTAB | FORMFEED | CR | LF | comment
>
> ; the core implementations here need to be
> ; factored out, as the sweet-expr parser needs
> ; to do similar processing when differentating
> ; between space-significant and space-insignificant
> ; quote.
> mdn-expr -> QUOTE any-space* mdn-expr
>   (list 'quote $3)
> mdn-expr -> QUASIQUOTE any-space* mdn-expr
>   (list 'quasiquote $3)
> mdn-expr -> UNQUOTE any-space* mdn-expr
>   (list 'unquote $3)
> mdn-expr -> UNQUOTE-SPLICING any-space* mdn-expr
>   (list 'unquote-splicing $3)
> mdn-expr -> mdn-expr-post-quote
>   $1
>
> ; use a different base-expr here:
> ; disallow post-mdn-expr after things
> ; like STRING, NUMBER, OTHER
> mdn-expr-post-quote -> base-expr-postable post-mdn-expr
>   ($2 $1)
> mdn-expr-post-quote -> base-expr
>
>   $1
>
> post-mdn-expr -> post-mdn-expr-1 post-mdn-expr
>   (lambda (e) ($2 ($1 e)))
> post-mdn-expr -> post-mdn-expr-1
>   $1
>
> post-mdn-expr-1 -> list-notation
>   (lambda (e) (cons e $1))
> post-mdn-expr-1 -> LBRACKET list-content RBRACKET
>
>   (lambda (e) (cons 'bracketaccess (cons e $2)))
> post-mdn-expr-1 -> curly-infix
>   (lambda (e) (list e $1))
>
> list-notation -> LPARENS list-content RPARENS
>   $2
> ; CONS = . i.e. the dotted-pair operator
> list-content -> any-space* CONS any-space* mdn-expr any-space*
>   $4
> list-content -> any-space* mdn-expr list-content
>   (cons $2 $3)
> list-content -> any-space*
>   '()
>
> base-expr-postable -> SYMBOL
>   $1
> base-expr-postable -> list-notation
>   $1
> base-expr-postable -> bracket-notation
>   $1
> base-expr-postable -> curly-infix
>   $1
>
> ; basically, these cases involve calling
> ; the built-in reader.
> base-expr -> STRING
>   $1
> base-expr -> NUMBER
>   $1
> base-expr -> OTHER ; i.e. for #x reader
>   $1
> base-expr -> base-expr-postable
>   $1
>
> ; again, hook for language-specific bracket meanings
> bracket-notation -> bracket-notation-scheme
>   $1
> bracket-notation-scheme -> LBRACKET list-content RBRACKET
>   $2
> bracket-notation-arc -> LBRACKET list-content RBRACKET
>   (list 'lambda (list '_) $2)
>
> anyone find more bugs?
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Readable-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/readable-discuss

Reply via email to