hi,
in squim I need to interoperate with javascript and javascript
objects, that's why I provide a way to wrap JS objects and be able to
use them in squim.
to access attributes of an object in squim I implement the apply
method on the Object type, when called it will get the first parameter
and if it's a symbol it will resolve that symbol and call the result
with the remaining unevaluated parameters, something like:
(person location address)
will do ((person location) address)
this also allows calling methods in an object
(browser open "
http://google.com")
it will even allow calling operatives since the remaining args aren't evaluated.
what do you think?
I thought about an alternative of having a type and some accessor
functions but it's not that OO and since I'm dealing with objects it
makes sense to be OO :)
what I like of this solution is that it looks like message passing and
would allow to define a method in term of more than one symbol doing
some kind of pattern matching or currying
PS: this is another reason of why I need code metadata, if I read
"(person location address)" back, I can't be sure it's an object
access or a function call and I would like to provide the user with a
way to enter in the ui "person.location.address" and translate it to
the squim way below.