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

lib: add list tail function #64

Merged
merged 1 commit into from
May 28, 2024
Merged

lib: add list tail function #64

merged 1 commit into from
May 28, 2024

Conversation

efd6
Copy link
Collaborator

@efd6 efd6 commented May 28, 2024

This allows easier accounting free worklist use. Initial thought included having head([]T, int) -> [] and tail([]T, int) -> [] that would consume up to the integer value's elements of the list, but these can be added later if needed.

Please take a look.

@efd6 efd6 added enhancement New feature or request Team:Security-External Integrations Label for the Security External Integrations team labels May 28, 2024
@efd6 efd6 self-assigned this May 28, 2024
@efd6 efd6 requested a review from a team May 28, 2024 07:08
@efd6 efd6 marked this pull request as ready for review May 28, 2024 07:10
@efd6 efd6 force-pushed the lispy_lists branch 2 times, most recently from a30c033 to c4cb4c6 Compare May 28, 2024 10:24
@efd6 efd6 changed the title lib: add list head and tail functions lib: add list tail function May 28, 2024
This allows easier accounting free worklist use.
// and b is []:
//
// a[?0] // return 1
// b[?0] // return optional.none
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is very helpful to spell out.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially I had it implemented as head, but later realised with optional types I can get exactly the same behaviour with this, so the doc seemed like it would be helpful.

@efd6 efd6 merged commit 1511fff into dev May 28, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Team:Security-External Integrations Label for the Security External Integrations team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants