0

If, in the OpenCyc browser SubLisp Interactor, I evaluate...

(ke-create "Foo")

...Then, as expected I end up with the term #$Foo.

and then, later (perhaps thousands of funcalls later) happen to call

(ke-create "Foo")

again, I end up with two terms. The other term is called Foo- where n is some small apparently random integer.

Why do I end up with two terms? It seems to me that if I repeat calls to create a constant by the name Foo, I should end up with exactly one new term, right?

This is a pain. Does it mean my code has to check each time it calls (ke-create "Foo") to make sure it hasn't called that before? Is there some way of disabling this annoying feature?

Bill
  • 111
  • 8

1 Answers1

1

Yes, there is. Use the SubL function fi-find-or-create instead.

If your knowledge generation code ends up calling (fi-find-or-create "Foo") repeatedly and you will happily end up creating just one term i.e. #$Foo.

(If you had done this with ke-create you'd end up with a bunch of junk terms. I.e. not just the desired #$Foo, but also stuff like #$Foo-2, #$Foo-11, #$Foo-9, #$Foo-5 etc (as implied by some of the text in the question))

Bill
  • 111
  • 8