Problem with defglobal in 64x

21 views
Skip to first unread message

denis.be...@gmail.com

unread,
Apr 29, 2021, 11:47:55 PM4/29/21
to CLIPSESG

On my Mac (running Catalina), with release 800, branch 64x (core compiled using "make"):

(defglobal ?*potential-numbers* = (create$ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 ))

(defglobal ?*numbers* = (subseq$ ?*potential-numbers* 1 9))

?*numbers*

(1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 )


branch 63x gives the correct answer: (1 2 3 4 5 6 7 8 9).

Notice that (subseq$ (create$ 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25) 1 9)
gives the correct answer, so that the problem is not in function  subseq$.

CLIPS Support

unread,
Apr 30, 2021, 8:08:42 PM4/30/21
to CLIPSESG
A lot of the internal functions used by the pattern matcher retrieve multifield variable values by referencing the entire multifield value from the containing slot along with a starting position and range. It's quicker than dynamically creating the values. The subseq$ and rest$ functions also use that mechanism, but there was a missing piece of code that converted the value into a form suitable for assigning to the global variable. A fix has been checked into the svn repository on sourceforge.
Reply all
Reply to author
Forward
0 new messages