"Bug" in SYMBOL data type de...

Help
pron
2012-10-02
2012-11-23
  • pron
    pron
    2012-10-02

    Hello!!

    As I can read in the "Clips_basic_programming_guide.pdf" the SYMBOL data type is defined like this:

    "A symbol in CLIPS is any sequence of characters that starts with any printable ASCII character and is followed by zero or more printable ASCII characters." (page 7)

    However I can not create this kind of instances:
    (defclass ORDER (is-a USER)
    (slot state (allowed-symbols 1 2 3 4 5 a b c d))
    )

    or facts:
    (deftemplate order (slot state (allowed-symbols 1 2 3 4 5 a b c d)))

    I think the problem is that the values 1, 2, 3, 4 and 5 are INTEGER types but they should be also SYMBOLYC, don't?

    CLIPS> (integerp 2)
    TRUE
    CLIPS> (symbolp 2)
    FALSE -> (Shouldn't be TRUE?)

    Thankyou!!

     
  • Gary Riley
    Gary Riley
    2012-10-02

    If you read a little further you'll see the following:

    Note that numbers are a special case of symbols (i.e. they satisfy the definition of a symbol, but they are treated as a different data type).