Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 characters #65

Merged
merged 18 commits into from
Oct 27, 2022
Merged

64 characters #65

merged 18 commits into from
Oct 27, 2022

Conversation

skx
Copy link
Owner

@skx skx commented Oct 26, 2022

Once complete this pull-request will close #64, by supporting character literals.

Character literals look like this:

  • #\a -> "a"
  • #\X -> "X"
  • #\\n -> "\n"
  • #\\r -> "\r"
  • #\\t -> "\t"

No other escape sequences are supported than "\n", "\r", or "\t".

TODO:

  • Improve our escape-handling
    • A hard-coded list, but errors are immediately apparent, and adding new ones is easy.
  • Add test cases
  • Look at which builtin-functions should be added.
    • Perform the necessary additions.
  • Look at which builtin-functions should be changed.
    • Perform the necessary changes.

@skx skx self-assigned this Oct 26, 2022
@skx
Copy link
Owner Author

skx commented Oct 26, 2022

Functions to be added:

  • Character comparisons, as noted in Support character literals #64.
  • Functions to be updated:
    • random:char should return a character, not a string.
    • chr should return a character
    • ord should operate upon either strings, or characters.
  • Functions to add:
    • (explode str) -> (char1 char2 .. charN)
      • join as the inverse should work as-is

@skx
Copy link
Owner Author

skx commented Oct 27, 2022

TODO:

  • Add "char<", then implement the other character functions in lisp, as we do for numbers.

@skx skx merged commit 8253a3c into master Oct 27, 2022
@skx skx deleted the 64-characters branch October 27, 2022 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support character literals
1 participant