Why 'neq' is not '!eq'

157 views
Skip to first unread message

Artem Novikov

unread,
May 23, 2015, 9:31:54 PM5/23/15
to clip...@googlegroups.com
CLIPS> (eq nil nil nil)
TRUE
CLIPS> (eq nil nil 1)
FALSE
CLIPS> (neq nil nil nil)
FALSE
CLIPS> (neq nil nil 1)
FALSE
CLIPS> 

Why  (neq nil nil 1) return false?

CLIPS Support

unread,
May 24, 2015, 4:26:09 PM5/24/15
to clip...@googlegroups.com, novi...@gmail.com
From the 6.3 Basic Programming Guide (http://clipsrules.sourceforge.net/documentation/v630/bpg.pdf):

12.1.12 Comparing for Inequality

The neq function returns the symbol TRUE if its first argument is not equal in value to all its subsequent arguments, otherwise it returns the symbol FALSE. 

Artem Novikov

unread,
May 24, 2015, 5:08:31 PM5/24/15
to clip...@googlegroups.com, novi...@gmail.com
..t is not equal in value to all its subsequent arguments..

CLIPS> (neq nil 1 1)
TRUE

ok, works fine

воскресенье, 24 мая 2015 г., 23:26:09 UTC+3 пользователь CLIPS Support написал:

Joshua Scoggins

unread,
May 26, 2015, 3:17:04 AM5/26/15
to clip...@googlegroups.com
In fact, (not (neq ?a (expand$ $?args))) is an easy way to see if the first arg is equal to one of the other arts.
Reply all
Reply to author
Forward
0 new messages