Skip to content

Instantly share code, notes, and snippets.

@seven-phases-max
Created February 3, 2014 21:48
Show Gist options
  • Save seven-phases-max/8793128 to your computer and use it in GitHub Desktop.
Save seven-phases-max/8793128 to your computer and use it in GitHub Desktop.
@import "for";
// ............................................................
.find(@array, @value, @fallback: -1) {
.for(@list); .-each(...) {}
.-each(~'@{value}') {@-: @i}
.-() {@-: @fallback} .-;
}
// ............................................................
@list: banana, apple, pear, potato, carrot, peach;
#basic-usage {
potato-index: @-; .find(@list, potato);
& {tomato-index: @-; .find(@list, tomato)}
}
@Hellowor1d
Copy link

Thanks for your solution, but where is the "for" file ?

@seven-phases-max
Copy link
Author

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