Created
July 4, 2012 21:37
-
-
Save Radagaisus/3049664 to your computer and use it in GitHub Desktop.
from array, get a: 2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| does = from = (arr, using) -> | |
| for i in arr when using[0] i | |
| return using[1] i | |
| return using[2] | |
| get = (obj) -> | |
| for key,val of obj | |
| return [ | |
| (i) -> i[key] is val | |
| (i) -> i | |
| (i) -> false | |
| ] | |
| have_any = (obj) -> | |
| for key, val of obj | |
| return [ | |
| (i) -> i[key] is val | |
| (i) -> true | |
| (i) -> false | |
| ] | |
| from array, get a: 2 | |
| does array, have_any c: 5 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment