basic: DEFUN can call other DEFUN (different from currying it, currying would return a function, but calling would return a value)

This commit is contained in:
minjaesong
2020-12-27 12:36:48 +09:00
parent 83a53499bc
commit 29e08923cc
3 changed files with 50 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
1 OPTIONDEBUG 1:OPTIONTRACE 1
10 DEFUN APPLY(X,F)=F(X):REM bug- F<~X must return function and F(X) must return value but right now they both return a function?
10 DEFUN APPLY(F,X)=F(X)
20 DEFUN FUN(X)=X^2
30 K=APPLY(42,FUN)
30 K=APPLY(FUN,42)
100 PRINT K
110 PRINT TYPEOF K
120 RESOLVE K