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

Require ambiguous initialization to be clarified #169

Open
okamsn opened this issue Sep 10, 2023 · 1 comment
Open

Require ambiguous initialization to be clarified #169

okamsn opened this issue Sep 10, 2023 · 1 comment
Labels
breaking changes enhancement New feature or request validation Things that should raise/prevent errors

Comments

@okamsn
Copy link
Owner

okamsn commented Sep 10, 2023

For some compatible accumulations, the initial value depends on which command
the macro parses first. This can be a source of error.

  ;; => 27
  (loopy (numbers i :from 1 :to 3)
         (sum my-accum i) ; Starts at 0.
         (multiply my-accum i)
         (finally-return my-accum))

  ;; => 21
  (loopy (numbers i 1 3)
         (multiply my-accum i) ; Starts at 1.
         (sum my-accum i)
         (finally-return my-accum))

It might be better to signal an error and make the user be explicit using the
with special macro argument.

@okamsn okamsn added enhancement New feature or request validation Things that should raise/prevent errors breaking changes labels Sep 10, 2023
okamsn added a commit that referenced this issue Aug 20, 2024
- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

See also this PR #203 and issue #169.
okamsn added a commit that referenced this issue Aug 20, 2024
- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

See also this PR #203 and issue #169.
okamsn added a commit that referenced this issue Aug 20, 2024
- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

- Update Org documentation and Texinfo file to note this new warning.

See also this PR #203 and issue #169.
okamsn added a commit that referenced this issue Aug 20, 2024
- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

- Update Org documentation and Texinfo file to note this new warning.

See also this PR #203 and issue #169.
github-actions bot added a commit that referenced this issue Aug 20, 2024
…lizations. (#203)

This commit was copied from the master branch.

Commit: b088504
Author: okamsn <[email protected]>
Date: 2024-08-20 01:41:17 +0000

Signal a warning for incompatible accumulation initializations. (#203)

- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

- Update Org documentation and Texinfo file to note this new warning.

See also this PR #203 and issue #169.
github-actions bot added a commit that referenced this issue Aug 20, 2024
…lizations. (#203)

This commit was copied from the master branch.

Commit: b088504
Author: okamsn <[email protected]>
Date: 2024-08-20 01:41:17 +0000

Signal a warning for incompatible accumulation initializations. (#203)

- Rename error `loopy-incompatible-accumulations` to
  `loopy-incompatible-accumulation-types`.

- Create the error `loopy-incompatible-accumulation-initializations`,
  but don't use it yet.

- Signal a warning an there are multiple expected starting values for an
  accumulation variable.  In the future, this will signal an error.

- Update Org documentation and Texinfo file to note this new warning.

See also this PR #203 and issue #169.
@okamsn okamsn changed the title Require ambiguous initialization to be clarified? Require ambiguous initialization to be clarified Aug 20, 2024
@okamsn
Copy link
Owner Author

okamsn commented Aug 20, 2024

We've added a warning. After this version is released, it will be switched to an error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking changes enhancement New feature or request validation Things that should raise/prevent errors
Projects
None yet
Development

No branches or pull requests

1 participant