Skip to content

Instantly share code, notes, and snippets.

@zenna
Created January 14, 2015 03:27
Show Gist options
  • Save zenna/13dd7c3b8fd1618cbec7 to your computer and use it in GitHub Desktop.
Save zenna/13dd7c3b8fd1618cbec7 to your computer and use it in GitHub Desktop.
Trying to esc vector of variables in macro
macro window(name, data...)
namestring = string(name)
quote
filters = getfilters(symbol($namestring))
if !isempty(filters)
for filter in filters
filter.enabled && filter.f($(data...))
end
end
end
end
@vtjnash
Copy link

vtjnash commented Jan 14, 2015

why not:

function window(name, data...)
  namestring = symbol(string(name))
  return function()
  filters = getfilters(name)
  if !isempty(filters)
    for filter in filters
      filter.enabled && filter.f(data...)
    end
  end
  end
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment