﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1780	wishlist: support keywords in coops (make <class>  ...) form	Shawn Rutledge	felix winkelmann	"As described in SRFI-88, keywords are nice to have for widget constructors:

(tcltk-frame relief: 'ridge
                 borderwidth: 4
                 height: ""50px""
                 width: ""100px"")

but if widgets are coops classes, it's natural to use the `make` form rather than a separate constructor procedure for each class:

(make <widget> width: 100 height: 50 ...)

I got it working with a quick hack (which no doubt could be more elegant):

{{{
Index: coops.scm
===================================================================
--- coops.scm   (revision 40393)
+++ coops.scm   (working copy)
@@ -9,9 +9,9 @@
 
 (declare (disable-interrupts))
 
-(import scheme matchable srfi-1 record-variants
+(import scheme matchable srfi-1 record-variants symbol-utils
         (chicken condition) (chicken fixnum) (chicken format)
-        (chicken syntax) (chicken sort)
+        (chicken keyword) (chicken syntax) (chicken sort)
         (only miscmacros ensure))
 (import-for-syntax matchable (chicken plist) srfi-1)
 
@@ -176,6 +176,7 @@
           (sv (make-vector (length slotnames) uninitialized))
           (i (make-coops-instance c sv)))
       (define (slot-index name)
+        (when (keyword? name) (set! name (keyword->symbol name)))
        (or (position name slotnames)
            (error ""no such slot in instances of given class"" name c)))
       (let loop ((svsv svsv))
}}}

Then one might expect it to be possible for slot names to be keywords in every other use case too (such as slot accessors); but I have custom syntax implemented for those anyway, so far like this:

(-> widget width) ; no colon, because it would look funny; no quote, for convenience
(=> widget width: 50)

I'd rather not have to wrap make in something custom, because it's already such a nice name.

In Chicken 4 it wasn't an issue, because (symbol? foo:) is true."	defect	closed	major	someday	extensions	5.2.0	wontfix			
