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

Improve lisp #449

Merged
merged 21 commits into from Dec 12, 2022
Merged

Improve lisp #449

merged 21 commits into from Dec 12, 2022

Conversation

vinc
Copy link
Owner

@vinc vinc commented Dec 1, 2022

Add improvements to the Lisp to be able to participate in the Advent of Code 2022.

  • Add chunks function
  • Add slice function
  • Add sort function
  • Add uniq function
  • Add filter function
  • Add intersection function
  • Add trim function
  • Add split function
  • Add chars function
  • Add words function
  • Add splice with @ shortcut in variadic functions
  • Change lines function
  • Change length function
  • Change set function

@vinc vinc changed the base branch from trunk to feature/geodate December 1, 2022 23:22
@vinc vinc changed the base branch from feature/geodate to trunk December 1, 2022 23:22
@vinc
Copy link
Owner Author

vinc commented Dec 2, 2022

The sort_by used in sort had to be changed to sort_unstable_by has it was causing a general protection fault while running the tests of the shell.

@vinc
Copy link
Owner Author

vinc commented Dec 4, 2022

Splitting the code of default_env reduced the kernel file size from 2008064 to 2000896 bytes. This is extremely close to the 2 MB limit where the kernel will overwrite beginning of the rest of the file system.

@vinc
Copy link
Owner Author

vinc commented Dec 7, 2022

The function (set <symbol> <value>) will now return the value instead of the symbol, unlike (define <symbol> <value>) that still returns the symbol.

(define i 0)    # => i
(set i (+ i 1)) # => 1
(set i (+ i 1)) # => 2

@vinc
Copy link
Owner Author

vinc commented Dec 8, 2022

Add splice with @ as a shortcut for variadic functions:

((function (a @b) a) 1 2 3) # => 1
((function (a @b) b) 1 2 3) # => (2 3)

@vinc vinc marked this pull request as ready for review December 12, 2022 17:43
@vinc vinc merged commit 87eb51d into trunk Dec 12, 2022
@vinc vinc deleted the feature/lisp branch December 12, 2022 17:43
@vinc vinc mentioned this pull request Dec 14, 2022
8 tasks
@vinc vinc mentioned this pull request Jun 20, 2023
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.

None yet

1 participant