Hi,

I'm trying to ensure some function I install at runtime on an object is 
actually callable (its name is a valid function name) but can't find a way to 
do that.

As I'm using 'aset' to install the property, any string can be using as name, 
e.g. 'invalid-name'. Calling obj.invalid-name() is invalid so I want to 
propagate that as an error.

Unfortunately 'aget' does not allow to detect that 'invalid-name' cannot be 
called as obj["invalid-name"] = function(){} will actually succeed and 
obj["invalid-name"] returns the function. Apparently the only way to ensure 
'invalid-name' is not callable is to check for 'obj.invalid-name' (which is 
undefined), in ClojureScript via '(. obj -invalid-name)'.
As my function names are defined at runtime I can't rely on this syntax.

Any idea on how I can achieve that?

Thanks,
Julien

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to