Last active
August 29, 2015 14:09
-
-
Save CMCDragonkai/96680fb72b932415d4ac to your computer and use it in GitHub Desktop.
OMetaJS: List Of Higher Order
This file contains 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
ometa List { | |
listOf :p = apply(p):head (',' apply(p))*:tail -> [head].concat(tail), | |
listOfDigits = listOf('digit'):l -> l, | |
END | |
} | |
var result = List.matchAll( | |
'1,2,3,4,5', | |
'listOfDigits' | |
); | |
console.log(result); | |
// result [1, 2, 3, 4, 5] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment