DISQUS

DISQUS Hello!  The comments on this profile are unclaimed and thus are unverified.

Do they belong to you? Claim these comments.

Patrick Geiller's picture

Unregistered

Feeds

aliases

  • Patrick Geiller
  • Patrick Geiller

Patrick Geiller

1 month ago

in A Naive, JScript Compatible Getter Pattern on shake, with fries
Use valueOf instead of toString, it's designed for that.

Your tactic can be problematic if you just store the value, like myArea1 = object.area. This will store the function and I don't think you'll be able to get your area back. Better push everyone to upgrade their browser :)
1 reply
zaach You're right, I wouldn't rely on this in production.

But you bring up an interesting point! myArea1 would indeed store a *reference* to the area function and, when coerced, would continue providing the current area of that object. It's like a detached getter, but is still bound to the object thanks to a closure. Useful? Probably not. But cool!

9 months ago

in Command line interpreter and REPL for JSCocoa on tlrobinson.net / blog

Nice ! Note that evalJSFile returns a BOOL instead of the js result, I'll need to modify that.


Getting arguments …


<ul>
<li>

in : JSCocoaFFIArgument.toJSValueRef to convert any command line argument to a js string or number

</li>
<li>

out : JSValueToStringCopy, JSStringCopyCFString to print results back to the command line

</li>
</ul>
Returning? Login