[PR #1113] Add iterate and iterateIndexed methods for Collections in the stdlib #892

Open
opened 2025-12-30 01:27:36 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/1113
Author: @stackoverflow
Created: 7/1/2025
Status: 🔄 Open

Base: mainHead: iterate-methods


📝 Commits (4)

  • 8e3b761 Add iterate and iterateIndexed methods for Collections in the stdlib.
  • e3d5187 Address review comments.
  • d353b85 Remove iterate functions and add folded function to short-circuit the other folding functions
  • a3ec194 Change folded function to not throw an exception

📊 Changes

10 files changed (+137 additions, -24 deletions)

View changed files

📝 pkl-core/src/main/java/org/pkl/core/runtime/BaseModule.java (+8 -0)
pkl-core/src/main/java/org/pkl/core/stdlib/base/FoldedException.java (+24 -0)
📝 pkl-core/src/main/java/org/pkl/core/stdlib/base/ListNodes.java (+20 -0)
📝 pkl-core/src/main/java/org/pkl/core/stdlib/base/SetNodes.java (+20 -0)
📝 pkl-core/src/main/resources/org/pkl/core/errorMessages.properties (+3 -0)
📝 pkl-core/src/test/files/LanguageSnippetTests/input/api/list.pkl (+17 -13)
📝 pkl-core/src/test/files/LanguageSnippetTests/input/api/set.pkl (+15 -11)
📝 pkl-core/src/test/files/LanguageSnippetTests/output/api/list.pcf (+4 -0)
📝 pkl-core/src/test/files/LanguageSnippetTests/output/api/set.pcf (+4 -0)
📝 stdlib/base.pkl (+22 -0)

📄 Description

No description provided


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/apple/pkl/pull/1113 **Author:** [@stackoverflow](https://github.com/stackoverflow) **Created:** 7/1/2025 **Status:** 🔄 Open **Base:** `main` ← **Head:** `iterate-methods` --- ### 📝 Commits (4) - [`8e3b761`](https://github.com/apple/pkl/commit/8e3b761d9ece3336f70265c9b2f4465336b4ef4c) Add `iterate` and `iterateIndexed` methods for `Collections` in the stdlib. - [`e3d5187`](https://github.com/apple/pkl/commit/e3d5187918f129c4e4af3150b92530a1bd7f0ad6) Address review comments. - [`d353b85`](https://github.com/apple/pkl/commit/d353b855082a9c3e0c09ae779f6b3b7cfb05903c) Remove iterate functions and add `folded` function to short-circuit the other folding functions - [`a3ec194`](https://github.com/apple/pkl/commit/a3ec1941cf7ee628c3bc759ad47b40c3fbfedc5a) Change folded function to not throw an exception ### 📊 Changes **10 files changed** (+137 additions, -24 deletions) <details> <summary>View changed files</summary> 📝 `pkl-core/src/main/java/org/pkl/core/runtime/BaseModule.java` (+8 -0) ➕ `pkl-core/src/main/java/org/pkl/core/stdlib/base/FoldedException.java` (+24 -0) 📝 `pkl-core/src/main/java/org/pkl/core/stdlib/base/ListNodes.java` (+20 -0) 📝 `pkl-core/src/main/java/org/pkl/core/stdlib/base/SetNodes.java` (+20 -0) 📝 `pkl-core/src/main/resources/org/pkl/core/errorMessages.properties` (+3 -0) 📝 `pkl-core/src/test/files/LanguageSnippetTests/input/api/list.pkl` (+17 -13) 📝 `pkl-core/src/test/files/LanguageSnippetTests/input/api/set.pkl` (+15 -11) 📝 `pkl-core/src/test/files/LanguageSnippetTests/output/api/list.pcf` (+4 -0) 📝 `pkl-core/src/test/files/LanguageSnippetTests/output/api/set.pcf` (+4 -0) 📝 `stdlib/base.pkl` (+22 -0) </details> ### 📄 Description _No description provided_ --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:27:36 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#892