[Top][All Lists]

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

Re: [MIT-Scheme-devel] Keywords

From: Joe Marshall
Subject: Re: [MIT-Scheme-devel] Keywords
Date: Fri, 19 Mar 2010 12:27:40 -0700

> On Tue, Mar 16, 2010 at 2:45 PM, Matt Birkholz
> <address@hidden> wrote:
>>    (make-sumpn :color: "red")
>> Sorry.  Not the last one?  ?
> Ok, I'll fix that.

Fixed, sort of.  I have removed the `both' option because I
couldn't clearly describe what it was supposed to do.

I have fixed the escaping of keywords to be just like SRFI-88
  In other words, in such implementations, |foo|: and foo: are
  the same keyword, and |foo:| is a symbol, not a keyword,
  and ||: is a keyword.

1 ]=> (set! *keyword-style* 'suffix)
;Value: #f

1 ]=> |foo|:
;Value 12: foo:

1 ]=> (keyword? |foo|:)
;Value: #t

1 ]=> (eq? foo: |foo|:)
;Value: #t

1 ]=> |foo:|
;Unbound variable: foo:
;To continue, call RESTART with an option number:
; (RESTART 3) => Specify a value to use instead of foo:.
; (RESTART 2) => Define foo: to a given value.
; (RESTART 1) => Return to read-eval-print level 1.

2 error> (restart 1)

1 ]=> (symbol? '|foo:|)
;Value: #t

1 ]=> (symbol? ||:)
;Value: #f

1 ]=> (keyword? ||:)
;Value: #t

1 ]=> (keyword? :color:)
;Value: #t

1 ]=> (keyword->string :color:)
;Value 13: ":color"

1 ]=> (transcript-off)

I have also restricted the value of *keyword-style* to be either
'prefix, 'suffix, or #f.

BTW:  I'd like to keep this as an `internal' feature until I figure
out the best way to control it.  I don't mind if people want to
play with it, but they should expect the `keyword-style' switch
to change and some other details to change for a bit until I
iron this out.  No guarantees of stable behavior, but I'd love
feedback from users.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]