mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-03-13 14:36:06 +09:00
basic: trying to solve why currying does not work as it should do in recursive function
This commit is contained in:
6
assets/qsort.bas
Normal file
6
assets/qsort.bas
Normal file
@@ -0,0 +1,6 @@
|
||||
10 DEFUN LESSER(P,X)=X<P
|
||||
11 DEFUN GTEQ(P,X)=X>=P
|
||||
12 DEFUN QSORT(XS)=IF LEN(XS)<1 THEN NIL ELSE QSORT(FILTER(CURRY(LESSER,XS(0)),XS)) # XS(0)!NIL # QSORT(FILTER(CURRY(GTEQ,XS(0)),XS))
|
||||
100 L=7!9!4!5!2!3!1!8!6!NIL
|
||||
110 SL=QSORT(L)
|
||||
120 PRINT L:PRINT SL
|
||||
Reference in New Issue
Block a user