> 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.
At this point, I am not exactly sure how the object model will be exposed to
Jess (either as beans or as non-bean Java objects.) For the purposes of
this discussion, either will do.
> 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.
>
Excellent! I didn't even think of doing it at this level (I suppose most of
Jess works like this anyway...) and simply assumed that low level Jess
lexer/parser work would be required.
BTW - If I implement it this way, would code with mistakes (such as passing
too few/many arguments to hset/hget) be caught at parse time or only at
run-time (pardon my ignorance w.r.t. UserFunctions?)
Support for traversals that use methods w/ arguments will get a little
tricky. For example:
(hget ?object member.submember.methodReturningObject("argument").submember)
This syntax is used (in the IE 4.0 object model) quite a bit for
parameterized collections such as:
(hget ?document all("htmlTagName").innerHTML)
but I think I can handle these fairly easily.
> Anyhow, if someone feels like doing a project, go for it. Ppst it
> here if you do.
I will. Thanks for the suggestion.
> 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...)
Well, I am not much of an editor junky/purist so I use most or all of these
tools depending on the context. As far as those who create the html/script,
they can and will use just about anything as there is no accounting for
taste!
---------------------------------------------------------------------
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]
---------------------------------------------------------------------