Commit Graph

13 Commits

Author SHA1 Message Date
Qi Xiao
e2f08af91b Change slice syntax to use .. instead of :.
Also support ..= for closed-range slices, a la Rust.

The old syntax is still supported, but deprecated.

This fixes #669.
2020-08-15 22:52:50 +01:00
Gabriel Rauter
1124c10b56
Add str:from-utf8-bytes, str:to-utf8-bytes and move builtin ord and chr to str module (#1081)
* pkg/eval/str: move builtin ord and chr to str

Move builtin string function ord and chr to the str module and rename to
to str:to-codepoints and str:from-codepoints respectively as suggested
in #851.

* pkg/eval/str: add from-utf8-bytes & to-utf8-bytes

Add from-utf8-bytes and to-utf8-bytes functions to the str module. This
functions differ from their *-codepoints in that they handle utf8 bytes
instead of whole codepoints. Closes #851

* pkg/eval/str: range check for codepoint and bytes

str:from-codepoints
Add check if arguments codepoints are within valid unicode range, return
an OutOfRange error otherwise. Return a BadValue error if the codepoint
isn't valid. Add/change testcases.

str:from-utf8-bytes
Add check if byte arguments are within valid range, return an OutOfRange
error otherwise. Return a BadValue error if the byte sequence isn't a
valid UTF-8 sequence. Add/change testcases.

Add additional test if piping from str:to-codepoints/str:to-utf8-bytes
to str:from-codpoints/str:from-utf8-bytes returns the original input.
2020-08-13 21:56:28 +01:00
Qi Xiao
b310b4fb1d Create new NEXT-RELEASE.md for 0.15.0. 2020-07-01 22:11:04 +01:00
Qi Xiao
6fe0d034dd Publish release notes of 0.14.0. 2020-07-01 22:09:28 +01:00
Qi Xiao
1808582f7f NEXT-RELEASE: Fix backslash (\ instead of \\). 2020-07-01 21:41:07 +01:00
Qi Xiao
06a00f4a5f pkg/parse: Show deprecation warning when using \ for line continuation.
This addresses #979.
2020-07-01 21:39:29 +01:00
Qi Xiao
e1e1c382f6 NEXT-RELEASE: Document the deprecation of the ^ command. 2020-06-30 23:37:09 +01:00
Qi Xiao
2e810c36c4 Update NEXT-RELEASE.md. 2020-06-30 23:27:23 +01:00
Qi Xiao
e9b4035896 pkg/eval: Move the show command into the builtin namespace.
This will likely become a basic operation in future that can support more types
than exceptions, so putting it in the builtin namespace is appropriate.

Also remove the exc: module altogether as it contains nothing now. All the
introspection features are now implemented as fields of the exception values and
the reason values.
2020-06-30 22:36:27 +01:00
Qi Xiao
088190b4a5 Address remaining feedback of #1018. 2020-06-28 01:33:27 +01:00
Qi Xiao
bd1a6e98dc pkg/eval/vals: Rework the structmap mechanism.
* Fields may now be exposed via getter methods.

* Field names are automatically converted to dashed-case.

* Assoc behavior is no longer implemented for structmaps.

* The IsStructMap marker method no longer takes a special marker argument. There
  is a little danger of a value accidentally implementing this method.
2020-06-28 01:26:58 +01:00
Qi Xiao
75be505c08 Make NEXT-RELEASE canonical. 2020-06-14 12:30:16 +01:00
Qi Xiao
d387e5111f Update CONTRIBUTING.md, and add a NEXT-RELEASE.md symlink.
This addresses #1045.
2020-05-31 01:42:26 +01:00