skylark: range(...) no longer materializes the sequence as a list (#25)
* skylark: range(...) no longer materializes the sequence as a list Skylark now follows the Python3, not Python2, semantics for range. Also: fix an off-by-one error. * range: allow membership tests 'x in range(n)' Change-Id: I0dffe70510f723c00da4153bcc0a17478cceb986 * range: allow floating point numbers for x in 'x in range(y)' - use ConvertToInt to convert x to an integer. - change ConvertToInt not to accept a bool. This affects string interpolation. e.g. "%d" % True now (correctly) results in an error. - rename ConvertToInt to NumberToInt Change-Id: Ie9e9d40d993c227b834bb720e5dbe3714032836a * range: doc tweaks Change-Id: I3f242d38a5969fa228167b72be6cb78aa4677eb6
Showing
- README.md 1 addition, 1 deletionREADME.md
- doc/spec.md 32 additions, 7 deletionsdoc/spec.md
- eval.go 7 additions, 1 deletioneval.go
- int.go 4 additions, 10 deletionsint.go
- library.go 98 additions, 14 deletionslibrary.go
- testdata/builtins.sky 34 additions, 10 deletionstestdata/builtins.sky
- testdata/int.sky 2 additions, 1 deletiontestdata/int.sky
- testdata/list.sky 1 addition, 1 deletiontestdata/list.sky
Loading
Please register or sign in to comment