-rot 2drop boolean-type
; 1 make-fa-primitive procedure?
+:noname ( args -- boolobj )
+ port-type istype? -rot 2drop boolean-type
+; 1 make-fa-primitive port?
+
\ }}}
\ ==== Type conversions ==== {{{
drop swap drop f> boolean-type
; 2 make-fa-primitive flo:>
+:noname ( flonum flonum -- bool )
+ drop swap drop f<= boolean-type
+; 2 make-fa-primitive flo:<=
+
+:noname ( flonum flonum -- bool )
+ drop swap drop f>= boolean-type
+; 2 make-fa-primitive flo:>=
:noname ( flonum -- bool )
drop 0.0 = boolean-type
current-input-port obj@
; 0 make-fa-primitive current-input-port
+:noname ( args -- charobj )
+ nil? if
+ 2drop current-input-port obj@
+ else
+ car port-type ensure-arg-type
+ then
+
+ read-char
+; make-primitive read-char
+
+:noname ( args -- charobj )
+ nil? if
+ 2drop current-input-port obj@
+ else
+ car port-type ensure-arg-type
+ then
+
+ peek-char
+; make-primitive peek-char
+
+:noname ( args -- stringobj )
+ nil? if
+ 2drop current-input-port obj@
+ else
+ car port-type ensure-arg-type
+ then
+
+ read-line
+; make-primitive read-line
+
: charlist>cstr ( charlist addr -- n )
dup 2swap ( origaddr addr charlist )
:noname ( args -- result )
2dup car 2swap cdr
-
+
nil? false = if car then ( proc argvals )
-
- apply
+
+ 2swap apply
; make-primitive apply
+:noname ( proc -- result )
+ make-continuation
+
+ drop if
+ nil cons
+ 2swap apply
+ else
+ 2swap 2drop
+ then
+
+; 1 make-fa-primitive call-with-current-continuation
+
\ }}}
\ ==== Miscellaneous ==== {{{
nil? if
." Error."
else
- ." Error: " car display
+ ." Error:"
+
+ 2dup car space display
+ cdr nil? invert if
+ begin
+ 2dup car space print
+ cdr nil?
+ until
+ then
+
+ 2drop
then
reset-term