Methods that "project out" of the type can be added to Listing and Mapping to avoid having to use toList()/toMap(). Methods that result in a Listing, resp. Mapping, are not included for performance and (lazy) semantics reasons, but methods like contains etc. can be defined straightforwardly.
🔄 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/683
**Author:** [@holzensp](https://github.com/holzensp)
**Created:** 10/14/2024
**Status:** ✅ Merged
**Merged:** 10/31/2024
**Merged by:** [@holzensp](https://github.com/holzensp)
**Base:** `main` ← **Head:** `cleanMappingListingParity`
---
### 📝 Commits (10+)
- [`e5c927f`](https://github.com/apple/pkl/commit/e5c927fe06a603ae6f93744e9b26856c5d82ba7e) Add `values` to `Mapping`
- [`66a8d38`](https://github.com/apple/pkl/commit/66a8d389c3c339177a7f1f96e8e26cfd6460ab21) Add `entries` to `Mapping`
- [`d515cc7`](https://github.com/apple/pkl/commit/d515cc726b999e0a5abbf3b0ea39be3510f5dfb3) Add `containsValue` to `Mapping`
- [`541659d`](https://github.com/apple/pkl/commit/541659d22d7d6a43f0e527901805b3215fa22129) Add `every` to `Mapping`
- [`239ea98`](https://github.com/apple/pkl/commit/239ea983cfc6509e7a5d6ac59562d9eb39b7d41b) Add `any` to `Mapping`
- [`90a68a5`](https://github.com/apple/pkl/commit/90a68a5e948730dca9dcd55fdfa04a7d46b90221) Add `toDynamic` to `Mapping`
- [`a069d05`](https://github.com/apple/pkl/commit/a069d05e88d19983deacbe4d662211265120c615) Add `lastIndex` to `Listing`
- [`ca8f0ed`](https://github.com/apple/pkl/commit/ca8f0edb7ecb157ecff1fd6c2e319904f9b3a9c1) Add `getOrNull` to `Listing`
- [`aa0f67f`](https://github.com/apple/pkl/commit/aa0f67f91c44e605fd5f9a3d6aaf9b870c4e9b58) Add `first` to `Listing`
- [`b90699a`](https://github.com/apple/pkl/commit/b90699ad6db1c2bf37ba46e877b5606715363e84) Add `firstOrNull` to `Listing`
### 📊 Changes
**8 files changed** (+503 additions, -11 deletions)
<details>
<summary>View changed files</summary>
📝 `pkl-core/src/main/java/org/pkl/core/stdlib/base/ListingNodes.java` (+144 -0)
📝 `pkl-core/src/main/java/org/pkl/core/stdlib/base/MappingNodes.java` (+55 -0)
📝 `pkl-core/src/main/resources/org/pkl/core/errorMessages.properties` (+6 -0)
📝 `pkl-core/src/test/files/LanguageSnippetTests/input/api/listing.pkl` (+78 -0)
📝 `pkl-core/src/test/files/LanguageSnippetTests/input/api/mapping.pkl` (+22 -3)
📝 `pkl-core/src/test/files/LanguageSnippetTests/output/api/listing.pcf` (+63 -0)
📝 `pkl-core/src/test/files/LanguageSnippetTests/output/api/mapping.pcf` (+16 -0)
📝 `stdlib/base.pkl` (+119 -8)
</details>
### 📄 Description
Methods that "project out" of the type can be added to `Listing` and `Mapping` to avoid having to use `toList()`/`toMap()`. Methods that result in a `Listing`, resp. `Mapping`, are not included for performance and (lazy) semantics reasons, but methods like `contains` etc. can be defined straightforwardly.
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/683
Author: @holzensp
Created: 10/14/2024
Status: ✅ Merged
Merged: 10/31/2024
Merged by: @holzensp
Base:
main← Head:cleanMappingListingParity📝 Commits (10+)
e5c927fAddvaluestoMapping66a8d38AddentriestoMappingd515cc7AddcontainsValuetoMapping541659dAddeverytoMapping239ea98AddanytoMapping90a68a5AddtoDynamictoMappinga069d05AddlastIndextoListingca8f0edAddgetOrNulltoListingaa0f67fAddfirsttoListingb90699aAddfirstOrNulltoListing📊 Changes
8 files changed (+503 additions, -11 deletions)
View changed files
📝
pkl-core/src/main/java/org/pkl/core/stdlib/base/ListingNodes.java(+144 -0)📝
pkl-core/src/main/java/org/pkl/core/stdlib/base/MappingNodes.java(+55 -0)📝
pkl-core/src/main/resources/org/pkl/core/errorMessages.properties(+6 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/api/listing.pkl(+78 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/input/api/mapping.pkl(+22 -3)📝
pkl-core/src/test/files/LanguageSnippetTests/output/api/listing.pcf(+63 -0)📝
pkl-core/src/test/files/LanguageSnippetTests/output/api/mapping.pcf(+16 -0)📝
stdlib/base.pkl(+119 -8)📄 Description
Methods that "project out" of the type can be added to
ListingandMappingto avoid having to usetoList()/toMap(). Methods that result in aListing, resp.Mapping, are not included for performance and (lazy) semantics reasons, but methods likecontainsetc. can be defined straightforwardly.🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.