Skip to content

Add higher level set macro to lisp#754

Merged
vinc merged 11 commits intotrunkfrom
feature/lisp-set
Jul 1, 2025
Merged

Add higher level set macro to lisp#754
vinc merged 11 commits intotrunkfrom
feature/lisp-set

Conversation

@vinc
Copy link
Owner

@vinc vinc commented Jun 29, 2025

MOROS Lisp had var to bind a value to a symbol and set to rebind another value to the symbol (causing an error if the variable didn't exist).

This PR will rename set to mut because it is a low level operation to mutate a variable, and create a new higher level set macro that either bind a value to a symbol with var if the variable doesn't exist or rebind the new value with mut otherwise.

This behavior add consistency between MOROS Lisp and MOROS Shell.

  • Rename set function to mut
  • Add var? function
  • Add set macro
  • Update doc
  • Update example scripts

@vinc vinc added the enhancement New feature or request label Jun 29, 2025
@vinc vinc changed the title Add higher level set macro Add higher level set macro to lisp Jun 29, 2025
@vinc
Copy link
Owner Author

vinc commented Jun 29, 2025

I'm working on adding def to MOROS Shell (#752) and with this PR they will both have the same def and set operations.

@vinc vinc marked this pull request as ready for review July 1, 2025 06:55
@vinc vinc merged commit 18f1913 into trunk Jul 1, 2025
1 check passed
@vinc vinc deleted the feature/lisp-set branch July 1, 2025 06:56
@vinc vinc mentioned this pull request Sep 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant