:noname ( args -- boolobj )
2dup 1 ensure-arg-count
- car primitive-type istype? -rot 2drop boolean-type
+ car primitive-proc-type istype? -rot 2drop boolean-type
; make-primitive procedure?
( = Type conversions = )
then
;
+: apply ( proc args )
+ 2swap dup case
+ primitive-proc-type of
+ drop execute
+ endof
+
+ compound-proc-type of
+ ." Compound procedures not yet implemented."
+ endof
+
+ bold fg red ." Object not applicable. Aboring." reset-term cr
+ abort
+ endcase
+;
+
:noname ( obj env -- result )
2swap
application? if
2over 2over
operator 2swap eval
-
- primitive-proc-type istype? false = if
- bold fg red ." Object not applicable. Aboring." reset-term cr
- abort
- then
-
-2rot
operands 2swap list-of-vals
- 2swap drop execute
+ apply
exit
then