Skip to content

Instantly share code, notes, and snippets.

@nex3
Created July 17, 2009 05:38
Show Gist options
  • Select an option

  • Save nex3/148913 to your computer and use it in GitHub Desktop.

Select an option

Save nex3/148913 to your computer and use it in GitHub Desktop.
!foo = 12
// Within this mixin, !foo refers to the argument,
// not to the global variable
=test-shadow(!foo)
!foo = !foo + 1
mixin-foo = !foo
a
+test-shadow(1)
non-mixin-foo = !foo
// Within the mixin, !foo refers to the global variable,
// even when it's called from a scope that defines !foo as a
// local variable.
=test-scope
child-foo = !foo
b
@for !foo from 0 to 1
+test-scope
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment