sink icon indicating copy to clipboard operation
sink copied to clipboard

Add runtime test to see if a native function is defined

Open velipso opened this issue 5 years ago • 1 comments

Should be able to write code like:

if isnative drawcircle
  drawcircle 100, 100, 20
end

Not exactly sure how this should work syntactically though. If isnative foo is parsed like normal, then foo will run, so it would need to hack around that. But then isnative <expr> wouldn't work -- which is probably fine..?

Then you couldn't do dynamic function checks, but that's probably fine.

Also, I'd have to look to see if validating a program ensures that all native functions exist... because that would be wrong if isnative exists, since program code could contain native functions that are never executed.

velipso avatar Nov 09 '18 13:11 velipso

This is now implemented on master, but the beta binaries don't have it... I will close the ticket once I get around to building a new beta

velipso avatar Nov 11 '18 19:11 velipso