Difference between revisions of "SubL/examples.constantp"

From Public Domain Knowledge Bank
Jump to: navigation, search
(constantp)
(constantp)
 
Line 7: Line 7:
 
  ?ignores arg2 ?
 
  ?ignores arg2 ?
 
  ERROR if arg0 or arg3 or more
 
  ERROR if arg0 or arg3 or more
==== constantp w/ 0 arg ====
+
==== constantp w/ 0 arg is ERROR ====
 
  CYC(56): (constantp)
 
  CYC(56): (constantp)
 
  Error: Cannot make an arity 0 function from #<Function CONSTANTP> {req=1 ...}
 
  Error: Cannot make an arity 0 function from #<Function CONSTANTP> {req=1 ...}
==== constantp w/ >2 arg ====
+
==== constantp w/ >2 arg is ERROR ====
 
  CYC(#): (constantp #$Lenat #$Lenat #$Lenat)
 
  CYC(#): (constantp #$Lenat #$Lenat #$Lenat)
 
  Error: Cannot make an arity 3 function from #<Function CONSTANTP> {req=1 opt=1 allowsrest=false}
 
  Error: Cannot make an arity 3 function from #<Function CONSTANTP> {req=1 opt=1 allowsrest=false}
Line 27: Line 27:
 
  [Time: 0.0 secs]
 
  [Time: 0.0 secs]
 
  NIL
 
  NIL
 +
===== (constantp 1) =====
 +
CYC(7): (constantp 1)
 +
[Time: 0.0 secs]
 +
T
 
==== constantp w/ 2 arg ====
 
==== constantp w/ 2 arg ====
 
===== (constantp #$Lenat "a") =====
 
===== (constantp #$Lenat "a") =====

Latest revision as of 03:16, 8 March 2019

SubL/examples.1

constantp

returns T if arg1 is a constant
returns NIL if arg1 is not a constant
?ignores arg2 ?
ERROR if arg0 or arg3 or more

constantp w/ 0 arg is ERROR

CYC(56): (constantp)
Error: Cannot make an arity 0 function from #<Function CONSTANTP> {req=1 ...}

constantp w/ >2 arg is ERROR

CYC(#): (constantp #$Lenat #$Lenat #$Lenat)
Error: Cannot make an arity 3 function from #<Function CONSTANTP> {req=1 opt=1 allowsrest=false}

constantp w/ 1 arg

(constantp "a")
CYC(54): (constantp "a")
[Time: 0.0 secs]
T
(constantp #$Lenat)
CYC(#): (constantp #$Lenat)
[Time: 0.002 secs]
T
(constantp 'a)
CYC(#): (constantp 'a)
[Time: 0.0 secs]
NIL
(constantp 1)
CYC(7): (constantp 1)
[Time: 0.0 secs]
T

constantp w/ 2 arg

(constantp #$Lenat "a")
CYC(#): (constantp #$Lenat "a")
[Time: 0.001 secs]
T