This is a Chicken Scheme egg which implements a QobiScheme-compatible define-structure macro. The resulting object is implemented as a chicken record. It automatically sets up reader syntax for reading and writing the object. It also integrates with the nondeterminism egg, see local-set-{name}-{field}!.
- (define-structure name . fields)
- (define-public-structure name . fields)
- (define-private-structure name . fields)
The following functions are generated when creating a structure.
- (make-{name} {field0-value} {field1-value} ...)
- (make-keywords-{name} {field-name}: {field-value} ...)
- ({name}? obj)
- ({name}-{field} obj)
- ({name}-{field}-set! obj val)
- (set-{name}-{field}! obj val)
- ({name}-{field}-setp! obj proc)
- (setp-{name}-{field}! obj proc)
- (local-set-{name}-{field}! obj val)
- (local-setp-{name}-{field}! obj proc)
- ({name}-{field}-update obj val)
- (update-{name}-{field} obj val)
- ({name}-{field}-updatep obj proc)
- (updatep-{name}-{field} obj proc)
- (set-{name}! obj {field-key}: {field-value} ...)
- (setp-{name}! obj {field-key}: {field-value} ...)
- (update-{name} obj {field-key}: {field-value} ...)
- (updatep-{name} obj {field-key}: {field-value} ...)
- (alist->{name} alist)
- ({name}->alist obj)
- (old-vector->{name} vector)
Copyright (c) 2013, Andrei Barbu, Purdue University All rights reserved.
Contact Andrei Barbu at andrei@0xab.com.
This program is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses.