[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #1780: wishlist: support keywords in coops (make <class> ...) form
From: |
Chicken Trac |
Subject: |
Re: #1780: wishlist: support keywords in coops (make <class> ...) form |
Date: |
Thu, 26 Aug 2021 05:32:48 -0000 |
#1780: wishlist: support keywords in coops (make <class> ...) form
---------------------------------------+---------------------
Reporter: Shawn Rutledge | Owner: (none)
Type: defect | Status: new
Priority: major | Milestone: someday
Component: extensions | Version: 5.2.0
Resolution: | Keywords:
Estimated difficulty: |
---------------------------------------+---------------------
Comment (by Shawn Rutledge):
Another chicken 4 trick was to define public slots as keywords and private
ones as symbols.
(define-class <rect> () ((x: 0) (y: 0) (w: 10) (h: 10) (private 'foo)))
(define r (make <rect> x: 50 'private "whee"))
(slot-ref r x:)
(slot-ref r 'private)
then I could make private slots inaccessible and convert public slot names
to keywords in the (-> ...) syntax:
(-> r x) ; no colon needed
(-> r private) ; not allowed
(raspbian still has chicken 4, so I was able to reproduce this on a
raspberry pi)
--
Ticket URL: <https://bugs.call-cc.org/ticket/1780#comment:1>
CHICKEN Scheme <https://www.call-cc.org/>
CHICKEN Scheme is a compiler for the Scheme programming language.