[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how useful are collecting lists?




On 03/13/2013 04:36 PM, David A. Wheeler wrote:
Actually, they weren't.  I was trying to be picky about what's allowed after "." (e.g., I don't think "$" and "\\" are sensible), and obviously was *too* picky.  You're absolutely right, that should be permitted.

So this is an important tip, we need to allow this case. I've changed the BNF and Scheme implementation so that a collecting list is legal after the dot in "rest".  Thus, this is now legal:
define x . <*
! define y 5

! define z 6
*>

I haven't modified "head", so if "." is the first atom on a line, a collecting list currently can't follow.  I can't figure out why you'd want to do that, I'd expect a user to just use a collecting list in that case.
My plan was to replace "<* begin" with ". <*" in the example, so this:

define-library
  example grid
  export make rows cols ref each rename(put! set!)
  import scheme(base)
  <* begin
;stuff
*>

becomes (in a scheme with implicit begin):

define-library
  example grid
  export make rows cols ref each rename(put! set!)
  import scheme(base)
  . <*
;stuff
*>

Does this run against your current "head" rule?

So we already have an important comment (from David Vanderson) that's pointed out a problem, and I've posted a possible solution (one that I hope others will agree is sensible).  Excellent!  Seems to me that's why we have a SRFI process...

--- David A. Wheeler


Definitely working out well for me so far. I'm only sorry that I didn't hear about it earlier - my first notice came from your post to the Racket dev list a week or so ago.

Thanks,
Dave