new version of make

cvs
Daniel Ehrenberg 2005-09-01 20:07:22 +00:00
parent bdbd011470
commit e6a24eb355
1 changed files with 6 additions and 5 deletions

View File

@ -188,13 +188,13 @@ M: comp-literal compile-ast ! literal numbers
compile-ast %
dup %
] each-with
] make-list nip ;
] [ ] make nip ;
M: vector compile-ast ! literal vectors
dup [ number? ] all? [
replace-with nip
] [
[ , ] accumulator [ make-vector nip ] cons
[ , ] accumulator [ { } make nip ] cons
] ifte ;
: infix-relation
@ -314,12 +314,13 @@ M: apply compile-ast ! function application
[ 1 - ] keep [
2dup - [ swap set-array-nth ] cons , \ keep ,
] repeat drop
] make-list ;
] [ ] make ;
: ast>quot ( args ast -- quot )
over prologue -rot compile-ast append ;
: define-math ( string -- )
: define-math ( seq -- )
" " join
dup parse-full apply-args uncons car swap
>apply< >r create-in r>
[ "math-args" set-word-prop ] 2keep
@ -331,7 +332,7 @@ M: apply compile-ast ! function application
"in-definition" on
string-mode on
[
" " join string-mode off define-math
string-mode off define-math
] f ; parsing
: TEST-MATH: