Although I really should have been more outspoken in my previous mail, I do
hope that the choice of words in my example ("confusion", "sore eyes") is an
indication that I'm very much against using this trick (which isn't even a
hack, let alone a haque), too.

Looking at the suitable places in the Jess manual, there is a definition
that a slot-name must be a symbol. This clearly rules out the usage of a
space. I didn't find a similar definition for template-name, but within a
template-name the "escaped space" trick is refused by the parser (a GOOD
thing). A function name is defined to be a symbol, but the trick works here,
too.

Escaping can be applied to other characters, too. So it's possible to define
a function which is pp-printed like this:
(deffunction .() ()
(printout t "Yikes!" crlf))
Jess> (.\(\))
Yikes!

Enough of this halloweenish horror!

But the final question is: Should language rules as they are stated in a
manual be enforced by the parser? It may not be so simple, since Jess has a
Java API where essentially all what can be done in Jess/CLP can be done by
calls where argument values don't have to be parsed so that all the
restrictions necessary for maintaining a lexical syntax could be dropped.


On Wed, Oct 29, 2008 at 7:34 PM, Jason Morris <[EMAIL PROTECTED]>wrote:

> Hi Uiratan,
>
> I would have thought that Ernest would caution you that what you are
> relying on is an implementation quirk of Jess that is not guaranteed to
> exist indefinitely since it's not part of the specified behavior of Jess.  I
> am not even sure why Protege allows it.
>
> Though Wolfgang's trick was very cool, I advise you against using it.
>
> If you read the Protege documentation, you will clearly see that there is a
> convention to follow regarding the naming of slots.  Using spaces in them is
> *not* following that convention.
>
> From the Protege documentation:
>
> "...A recommended convention is to make slot names lowercase, with words
> separated by an underscore. Making slot names lowercase, while making
> class[e] names start with an uppercase letter, helps you distinguish them in
> your ontology."
>
> Hacking around what is correct is just not good programming in my humble
> opinion.
>
> Cheers,
> Jason
>
>
> -----------------------------------------------------------
> Morris Technical Solutions LLC
> [EMAIL PROTECTED]
> (517) 304-5883
>

Reply via email to