How to define a dynamic mixin or function name in SASS?

Variable interpolation in @mixins does not appear to be supported currently. The SASS documentation calls this #{} interpolation and describes it like this: Interpolation: #{} You can also use SassScript variables in selectors and property names using #{} interpolation syntax: $name: foo; $attr: border; p.#{$name} { #{$attr}-color: blue; } Per the documentation, interpolation of variable … Read more

Python dynamic function creation with custom names

For what you describe, I don’t think you need to descend into eval or macros — creating function instances by closure should work just fine. Example: def bindFunction1(name): def func1(*args): for arg in args: print arg return 42 # … func1.__name__ = name return func1 def bindFunction2(name): def func2(*args): for arg in args: print arg … Read more