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

Add let expression support #478

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Add let expression support #478

merged 2 commits into from
Oct 30, 2024

Conversation

astrsh
Copy link
Member

@astrsh astrsh commented Oct 30, 2024

Pull Request

Description

Adds support for Paralithic let expressions (currently in Paralithic dev awaiting proper release). Let expressions enable the ability to bind names to expressions within the context of another expression, e.g.

5 + let
  a := 3.5,
  b := a^2, // Optional trailing comma
in a * b * (let d := sqrt(x) in cos(d))

As the introduction of let expressions may break config packs and the noise predicate addon (which uses the in invocation variable reserved as a keyword in let expressions), this must explicitly be enabled in pack.yml via the following:

expressions:
  options:
    enable-let-expressions: true

The noise predicate addon will use input instead of in if let expressions are enabled, which currently affects only the EXPRESSION_NORMALIZER sampler.

Checklist

Mandatory checks

  • The base branch of this PR is an unreleased version branch (that has a ver/ prefix)
    or is a branch that is intended to be merged into a version branch.
  • There are no already existing PRs that provide the same changes.
  • The PR is within the scope of Terra (i.e. is something a configurable terrain generator should be doing).
  • Changes follow the code style for this project. Code style can be applied prior to version branch merge
  • I have read the CONTRIBUTING.md
    document in the root of the git repository.

Types of changes

  • Bug Fix
  • Build system
  • Documentation
  • New Feature
  • Performance
  • Refactoring
  • Repository
  • Revert
  • Style
  • Tests
  • Translation

Compatibility

  • Introduces a breaking change
  • Introduces new functionality in a backwards compatible way.
  • Introduces bug fixes

Documentation

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly. TODO once version is merged

Testing

  • I have added tests to cover my changes.
  • All new and existing tests passed.

Licensing

  • I am the original author of this code, and I am willing to
    release it under GPLv3.
  • I am not the original author of this code, but it is in public domain or
    released under GPLv3 or a compatible license.

@duplexsystem duplexsystem merged commit bed67c2 into ver/6.6.0 Oct 30, 2024
1 check failed
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.

2 participants