[plt-dev] some Racket proposals & implementation

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Apr 3 17:23:36 EDT 2010

Attached is another version that adds:

better error messages everywhere
#:super
#:property
#:guard
#:inspector
#:transparent
#:prefab
compatibility with define-struct [you can use an sstruct as a struct parent]
compatibility with scheme/match's struct expander [you can use an
sstruct as a struct arg]

All with more tests, of course.

--

My #:super doesn't work the same as define-struct's.

I still don't support #:omit-define-syntaxes or #:omit-define-values.

I don't support #:auto. But should I since I allow default-value expressions?

I'm not sure what else is needed. Would we want to use this as the
default define-struct in #lang racket? Or should I put this in
unstable or on planet?

Jay

--

It requires revision 18730 of scheme/private/struct-info.
It requires the following patch to syntax/private/stxparse/rep:

Index: rep.ss
===================================================================
--- rep.ss	(revision 18530)
+++ rep.ss	(working copy)
@@ -843,11 +843,11 @@
                        "expected exact nonnegative integer or +inf.0"))
        (when (> minN maxN)
          (wrong-syntax stx "minimum larger than maximum repetition
constraint"))
-       (let ([chunks (parse-keyword-options #'options
+       (let ([chunks (parse-keyword-options/eol #'options
          (let ([too-few-msg
                 (options-select-value chunks '#:too-few #:default #'#f)]
                [too-many-msg

Ryan has received this and says he will commit it imminently.

On Sat, Apr 3, 2010 at 7:08 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Sat, 3 Apr 2010 06:31:58 -0400, Sam Tobin-Hochstadt wrote:
>> I think that it's struct type info that needs to be the property,
>
> `prop:struct-info' added in SVN.
>
>
>



-- 
Jay McCarthy <jay at cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sstruct-syn.ss
Type: application/octet-stream
Size: 3616 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100403/7b5522ee/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sstruct-tests.ss
Type: application/octet-stream
Size: 11050 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100403/7b5522ee/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sstruct.ss
Type: application/octet-stream
Size: 11724 bytes
Desc: not available
URL: <http://lists.racket-lang.org/dev/archive/attachments/20100403/7b5522ee/attachment-0002.obj>

Posted on the dev mailing list.