RapydScript icon indicating copy to clipboard operation
RapydScript copied to clipboard

generator expressions not working

Open JohnDenker opened this issue 10 years ago • 3 comments

Context

print(list([x, x**3] for x in range(6)))

Expected and Desired Behavior (regular python)

[[0, 0], [1, 1], [2, 8], [3, 27], [4, 64], [5, 125]]

Observed Behavior (RS)

ERROR: Unexpected token keyword «for», expected punc «,» [/home/jsd/physics/python-lambda.py:2,21]

/usrsrc/RapydScript/lib/parse.js:145
    throw new JS_Parse_Error(message, line, col, pos, is_eof);

Non-workaround

Lambda expressions don't seem to be working either; see item #99

JohnDenker avatar Sep 19 '15 16:09 JohnDenker

deleted -- wrong bug report

kovidgoyal avatar Sep 20 '15 00:09 kovidgoyal

https://github.com/kovidgoyal/rapydscript-ng/commit/338cd6b46d161fc4a3ba20e1463fe7425f92e057

kovidgoyal avatar Sep 20 '15 03:09 kovidgoyal

Won't be addressing this at this time, the difference is subtle enough from regular list comprehension and the change is invasive enough that I'll leave this alone until ES6 functionality becomes more prevalent in RS.

atsepkov avatar Sep 07 '16 07:09 atsepkov