<div dir="ltr">Hi - <br><br>it seems that the structs marked as procedures cannot accept keyword arguments, even if the procedure in prop:procedure does. Is this by design or there is a different way to mark struct as keyword procedures? <br>
<br>Thanks,<br>yc<br><br><span style="font-family: courier new,monospace;">> (define-struct *res (filter args)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> #:property prop:procedure</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (lambda (s x #:error (e #f))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> (let ((res (apply (*res-filter s) (cons x (*res-args s)))))</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (if (not e)</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> res</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> (error 'restriction))))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> )</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">> (define color (make-*res (lambda (x enum) (member x enum)) '((red white blue))))</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">> (color 'black #:error #t)</span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;">;; => error <br>procedure application: expected a procedure that accepts keyword arguments, given #(struct:*res #<procedure:...t/valere/res1\<br>.ss:10:25> (red white blue)); arguments were: black #:error #t <br>
<br></span></div>