How to implement a meta-circular evaluator to parse `[1..10]` in JavaScript?
问题 I want to implement a meta-circular evaluator in JS with support to functional programming. How can I parse this? [1..10] I want to receive 1 and 10 回答1: This is a basic implementation of generating a range. The goal you are talking about is going to be too complex for regex (firmly tongue in cheek). Using tagged template literal syntax. Regex finds two digit sequences, converts to numbers. Fills an array. range = (str,...args) => (([,min,max])=> Array(Math.abs(max-min)+1).fill(+min).map((_,i