From: Tim Vaughan Date: Sat, 3 Dec 2016 00:52:58 +0000 (+1300) Subject: Added NOT and fixed PROCEDURE? X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=f675338306652fc8accf3c5ba154b915d0d24cdc;p=scheme.forth.jl.git Added NOT and fixed PROCEDURE? --- diff --git a/src/scheme-library.scm b/src/scheme-library.scm index 8260f90..faa9288 100644 --- a/src/scheme-library.scm +++ b/src/scheme-library.scm @@ -82,6 +82,10 @@ (define exact? #t) (define inexact? #t) +; Logic + +(define (not x) (if x #f #t)) + ;; LISTS (define (list . args) args) diff --git a/src/scheme-primitives.4th b/src/scheme-primitives.4th index 9203f71..934c80e 100644 --- a/src/scheme-primitives.4th +++ b/src/scheme-primitives.4th @@ -29,7 +29,13 @@ ; 1 make-fa-primitive pair? :noname ( args -- boolobj ) - primitive-proc-type istype? -rot 2drop boolean-type + primitive-proc-type istype? if + true + else + compound-proc-type istype? + then + + -rot 2drop boolean-type ; 1 make-fa-primitive procedure? \ }}}