I think Moore, Kenneth A wrote:
> 
> > BUT in JavaScript the '.' operator means "get" -- in Jess, the
> > 'get' operator means '.'
> 
> Yes, 'get' in Jess does the right thing, but I would also like to be able to
> use '.'
> 

Well, there is a subtlety here: 'get' and 'set' do bean properties,
and 'get-member' and 'set-member' do member variables. You have to
either pick one or the other, or come up with a set of
rules explaining how to resolve conflicts.

Anyway, one way around this could be to write a hierarchical 'get'
Userfunction. Let's call it 'hget', but you could call it whatever
you'd like. It could work something like this

(hget ?object member.submember.subsubmember)

You could also have an hset:

(hset ?object member.submember.subsubmember ?value)

The Userfunction would have to parse the second argument and
recursively choose submembers using reflection, or, if the whole thing
was written in Jess, using (try) and (get) and (get-member). You could
use str-index and sub-string to pull the string apart into individual
names...  Actually, you could easily write it in Jess as a Deffunction using
perhaps two dozen lines of code, max. 

Anyhow, if someone feels like doing a project, go for it.  Ppst it
here if you do.

> BTW, the editor of choice is likely to be FrontPage 98*, HotDog*, or even
> Notepad* ;-)
> 

My condolences. Seriously, I wonder how anyone ever gets -any- work
done using this kind of tool (I'll even throw the MSVJ++/MSVC++ editor
into this pile, although it's very SLIGHTLY better, if you use the
Epsilon bindings...)

---------------------------------------------------------
Ernest Friedman-Hill  
Distributed Systems Research        Phone: (510) 294-2154
Sandia National Labs                FAX:   (510) 294-2234
Org. 8920, MS 9214                  [EMAIL PROTECTED]
PO Box 969                  http://herzberg.ca.sandia.gov
Livermore, CA 94550

---------------------------------------------------------------------
To unsubscribe, send the words 'unsubscribe jess-users [EMAIL PROTECTED]'
in the BODY of a message to [EMAIL PROTECTED], NOT to the
list. List problems? Notify [EMAIL PROTECTED]
---------------------------------------------------------------------

Reply via email to