Wiki
Download
Manual
Eggs
API
Tests
Bugs
show
edit
history
You can edit this page using
wiki syntax
for markup.
Article contents:
== Outdated egg! This is an egg for CHICKEN 4, the unsupported old release. You're almost certainly looking for [[/eggref/5/dsssl-utils|the CHICKEN 5 version of this egg]], if it exists. If it does not exist, there may be equivalent functionality provided by another egg; have a look at the [[https://wiki.call-cc.org/chicken-projects/egg-index-5.html|egg index]]. Otherwise, please consider porting this egg to the current version of CHICKEN. [[tags: egg]] == dsssl-utils [[toc:]] == Documentation An API to compensate for the #!rest #!key order of a DSSSL extended lambda list. The extension name is unfortunate since only the extended lambda list feature of DSSSL is involved. See [[simple-units|simple-units]] for something that might help with DSSSL {{quantities}}. === DSSSL Extended Lambda List Fixup ==== Usage <enscript language=scheme> (require-extension dsssl-utils) </enscript> ==== dsssl-fixup <macro>(dsssl-fixup OPTIONALS KEYS REST BODY...)</macro> Expands the {{BODY...}} in a new lexical scope where the {{#!optional}}, {{#!key}}, and {{#!rest}} variables have the ''correct'' value. {{OPTIONALS}} is {{(OPTIONAL-BINDING...)}}. {{KEYS}} is {{((KEYWORD KEYWORD-BINDING)...)}}, where {{KEYWORD}} is a {{keyword}}. {{OPTIONAL-BINDING}} & {{KEYWORD-BINDING}} have the form: ; ({{IDENTIFIER}} {{DEFAULT}}) : as is ; ({{IDENTIFIER}}) : becomes ({{IDENTIFIER}} #f) ; {{IDENTIFIER}} : becomes ({{IDENTIFIER}} #f) ==== fixup-dsssl-lambda-list <procedure>(fixup-dsssl-lambda-list OPTIONALS KEYS REST) -> list list list</procedure> Returns 3 "correct" values: the rest {{list}}, optionals {{list}}, and keys {{list}}. : {{OPTIONALS}} ; {{((OPTIONAL-VALUE OPTIONAL-DEFAULT) ...)}}. : {{KEYS}} ; {{((KEYWORD KEYWORD-VALUE) ...)}}. : {{REST}} ; {{(...)}} ==== delete-keyword-arguments <procedure>(delete-keyword-arguments KEYS REST) --> list</procedure> Returns the "correct" rest {{list}}. : {{KEYS}} ; {{((KEYWORD KEYWORD-VALUE)...)}}. : {{REST}} ; {{(...)}} === DSSSL Extended Lambda List Replacements Provides formal argument binding in the ''correct'' order. This means an optional will not be bound to a keyword, the rest argument list will not have any optional or keyword values, and keyword arguments are bound to the proper value. ==== Usage <enscript language=scheme> (require-extension lambda+) </enscript> ==== define+ <macro>(define+ (NAME [ARGUMENT...]) BODY...)</macro> Replacement for {{define}} that uses {{lambda+}}, if necessary. The ''curried define'' form is recognized. The {{define}} form {{(name arg0 arg1 ... . rest)}} is '''not''' supported. However {{(name . rest)}} is recognized. In any case this is about extended lambda lists so use {{#!rest}}. ==== lambda+ <macro>(lambda+ [REQUIRED...] [#!optional OPTIONAL...] [#!rest REST] [#!key KEY...])</macro> Replacement for {{lambda}} that that binds formals in the ''correct'' order. === Typed Define ==== Usage <enscript language=scheme> (require-extension typed-define) </enscript> ==== define: <macro>(define: (NAME [(ARGUMENT VALUETYPE) ... [. (REST VALUETYPE)]]) [->|--> RESULTTYPE] BODY...)</macro> {{(: NAME (VALUETYPE ... [#!rest VALUETYPE] [->|--> RESULTTYPE]))}} {{(define (NAME [ARGUMENT ... [. REST]]) BODY...)}} '''No''' runtime type checking is performed. ==== define:-record-type <macro>(define:-record-type TAG (CTOR [FLD-NAME ...]) PRED-NAME [((FLD-NAME FLD-TYPE FLD-REF [FLD-SET!]) ...)])</macro> Defines types for the {{TAG}}, {{CTOR}}, {{FLD-REF}}, & any {{FLD-SET!}} '''No''' runtime type checking is performed. == Examples <enscript language=scheme> (use dsssl-utils) (define (f a1 a2 #!optional (o1 'x) o2 #!rest rest #!key k1 k2) (print `((a1 ,a1 a2 ,a2) (o1 ,o1 o2 ,o2) (#:k1 ,k1 #:k2 ,k2) (rest ,rest))) (dsssl-fixup ((o1 'x) o2) ((#:k1 k1) (#:k2 k2)) rest `((a1 ,a1 a2 ,a2) (o1 ,o1 o2 ,o2) (#:k1 ,k1 #:k2 ,k2) (rest ,rest)) ) ) (f 1 2 3 #:k1 4 5 6 #:k2 7 8 9) ;=> ((a1 1 a2 2) (o1 3 o2 k1:) (k1: #f k2: #f) (rest (4 5 6 k2: 7 8 9))) ((a1 1 a2 2) (o1 3 o2 5) (k1: 4 k2: 7) (rest (6 8 9))) </enscript> <enscript language=scheme> (use lambda+) (define (foo r1 r2 #!optional o1 (o2 '()) #!rest rest #!key k1 (k2 'foo)) `((,r1 ,r2) (,o1 ,o2) (,k1 ,k2) ,rest) ) (define+ (foo+ r1 r2 #!optional o1 (o2 '()) #!rest rest #!key k1 (k2 'foo)) `((,r1 ,r2) (,o1 ,o2) (,k1 ,k2) ,rest) ) (foo 1 2 3 #:k1 4 5 6 7 8) ;=> ((1 2) (3 #:k1) (#f foo) (4 5 6 7 8)) (foo+ 1 2 3 #:k1 4 5 6 7 8) ;=> ((1 2) (3 5) (4 foo) (6 7 8)) </enscript> == Author [[/users/kon-lovett|Kon Lovett]] == Version history ; 2.2.2 : Fix {{delete-keyword-arguments}}. ; 2.2.1 : Fix {{delete-keyword-arguments}}. ; 2.2.0 : Deprecate {{scrub-dsssl-keys}}. Add {{delete-keyword-arguments}}, {{define:}}, {{define:-record-type}}. ; 2.1.0 : Add {{define:}} & {{define:-record-type}}. ; 2.0.1 : Fix for ticket #630 ; 2.0.0 : ; 1.0.0 : Added {{lambda+}} & {{define+}}. ; 1.0.0 : Hello == License Copyright (C) 2010-2018 Kon Lovett. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the Software), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED ASIS, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Description of your changes:
I would like to authenticate
Authentication
Username:
Password:
Spam control
What do you get when you subtract 19 from 20?