Action:
|
Determines whether or not a Scheme object is of the
law Scheme data type.
|
|
Filename:
|
kern/kern_scm/law_scm.cxx
|
|
Syntax:
|
(law? object)
|
|
Arg Types:
|
object
|
scheme-object
|
|
Returns:
|
boolean
|
|
Description:
|
This extension returns a
#t if the given
object is a
law Scheme data type. Otherwise, it returns a
#f.
|
|
|
object specifies a
scheme-object that has to be queried for a law.
|
|
Example:
|
; law?
|
|
; Create a new law.
|
|
(define law1 (law "x+x^2-cos(x)"))
|
|
;; law1
|
|
; Test to see if item is a law Scheme data type.
|
|
(law? law1)
|
|
;; #t
|
|
; Evaluate the given law at 1.5 radians
|
|
(define answer (law:eval law1 1.5))
|
|
;; answer
|
|
; Test to see if item is a law Scheme data type.
|
|
(law? answer)
|
|
;; #t
|
|
; This is true, because real numbers can be laws.
|