1 (in-package #:as3-compiler
)
3 ;;; implement functions/macros from CL package
5 ;;; most probably don't match CL semantics very closely yet...
7 ;;; conses dictionary (14.2)
9 ;;; not sure what best internal rep for conses is,
10 ;;; could use anonymous object
12 ;;; instances of named class
15 ;;; named class is probably easiest to recognize for type checking
16 ;;; so trying that first
17 ;;; anon object with car and cdr properties might also be nice, and
18 ;;; just allow any object with those to be used as a 'cons', but
19 ;;; wouldn't match CL sematics very well
20 (let ((*symbol-table
* *cl-symbol-table
*))
21 ;; todo: probably should figure out how to make this final/sealed/etc.
22 (def-swf-class cons-type
"cons" object
(%car %cdr
)
24 (%set-property this %car a
)
25 (%set-property this %cdr b
)))
27 (swf-defmemfun cons
(a b
)
28 (%asm
(:find-property-strict cons-type
)
31 (:construct-prop cons-type
2)))
33 (swf-defmemfun car
(a)
37 (:get-property %car
))))
38 (swf-defmemfun cdr
(a)
41 (if (%typep a cons-type
)
44 (%error
"type-error: unknown type cdr"))))