more fixes
parent
8d5ffb360b
commit
076dd4fa43
|
@ -56,8 +56,11 @@ USE: stack
|
|||
#! [ [ 1 | "one" ] [ 2 | "two" ] [ 3 | "three" ] ]
|
||||
assoc* dup [ cdr ] when ;
|
||||
|
||||
: acons ( value key alist -- alist )
|
||||
>r swons r> cons ;
|
||||
|
||||
: set-assoc ( value key alist -- alist )
|
||||
#! Sets the key in the alist. Does not modify the existing
|
||||
#! list by consing a new key/value pair onto the alist. The
|
||||
#! newly-added pair 'shadows' the previous value.
|
||||
>r swons r> [ dupd car= not ] subset cons ;
|
||||
[ dupd car = not ] subset acons ;
|
||||
|
|
Loading…
Reference in New Issue