Skip to content

Instantly share code, notes, and snippets.

@drewlesueur
Created November 29, 2010 19:59
Show Gist options
  • Save drewlesueur/720506 to your computer and use it in GitHub Desktop.
Save drewlesueur/720506 to your computer and use it in GitHub Desktop.
Language experiment
# 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