Created
November 29, 2010 19:59
-
-
Save drewlesueur/720506 to your computer and use it in GitHub Desktop.
Language experiment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# link with an extra property .__meta | |
# or each object has a .__uid that links | |
# if you are going to have an extra property anyway, why not make it the meta property. | |
meta = {} | |
get = (scope, variable) -> | |
if scope.__meta.get? | |
return scope.__meta.get scope, variable | |
else | |
return scope[variable] | |
set = (scope, name, variable) -> | |
#todo: handle if 'variable; is a function | |
if scope.__meta.set? | |
return scope.__meta.set scope, variable | |
# eval = #same? | |
# call = #same? | |
#create a function | |
#a function is actually | |
# {scope: obj, function: func (array of commands to eval?)} | |
# hmm. not an array of commands to eval. an actual javascript function | |
# it will compile to an actual javascript function | |
# | |
func = (scope, commands) -> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment