2
;; Copyright (C) 2003,2004 Andy Wingo <wingo at pobox dot com>
2
;; Copyright (C) 2003,2004-2005 Andy Wingo <wingo at pobox dot com>
4
4
;; This program is free software; you can redistribute it and/or
5
5
;; modify it under the terms of the GNU General Public License as
175
175
(type type) (options options)
176
176
(message "Missing glist-of options form.")))))
177
177
(if (< (length options) 2)
181
(type type) (options options)
182
(message "glist-of options form must have at least 2 options.")))))
178
(raise-bad-typespec type options
179
"glist-of options form must have at least 2 options."))
183
180
(let ((sub-typespec (car options))
184
181
(glist-options (cdr options))
185
182
(remainder (cdr options)))
187
184
(if (not (is-a? sub-typespec <gw-typespec>))
190
(type type) (options options)
191
(message "glist-of options form must have a sub-typespec as first option.")))))
187
"glist-of options form must have a sub-typespec as first option."))
194
189
(set! remainder (delq 'const remainder))
195
190
(if (and (memq 'caller-owned remainder)
196
191
(memq 'callee-owned remainder))
199
(type type) (options options)
201
"Bad glist-of options form (caller and callee owned!).")))))
192
(raise-bad-typespec type options
193
"Bad glist-of options form (caller and callee owned!)."))
203
195
(if (not (or (memq 'caller-owned remainder)
204
196
(memq 'callee-owned remainder)))
208
(type type) (options options)
210
"Bad glist-of options form (must be caller or callee owned!).")))))
199
"Bad glist-of options form (must be caller or callee owned!)."))
211
200
(set! remainder (delq 'caller-owned remainder))
212
201
(set! remainder (delq 'callee-owned remainder))
213
202
(if (null? remainder)
216
205
#:sub-typespec sub-typespec
217
206
#:options glist-options)
220
(type type) (options options)
222
(format #f "Bad glist-of options form - spurious options: ~S"
209
(format #f "Bad glist-of options form - spurious options: ~S"
225
212
(define-method (unwrap-value-cg (glist-type <glist-of-type>)
226
213
(value <gw-value>)