-
-
Notifications
You must be signed in to change notification settings - Fork 661
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
More treelist utility functions #5106
base: master
Are you sure you want to change the base?
Conversation
Can you also add |
|
Two performance notes on
|
Added shortcuts for conversions to treelist from treelist, vector, and list. |
What's the rationale for adding these particular functions? Some of these seem arbitrary to me, like |
These are the list functions that I needed to re-implement for some projects I've been writing in Rhombus. Both (edit: and of course, not being able to call the subtract operation |
I'm having trouble seeing this as a rationale for adding to a core library. It seems like we should generally avoid adding things to this library, since everyone who loads I can see an argument for adding a few more functions that are known from experience to be very broadly useful. The As you may guess, I'm not a fan of the way |
Perhaps |
I don't think including the functionality of (edit: |
Perhaps if a |
Switching to |
I'm not a fan of making |
Good point. I think the Rhombus |
I think I have needed to use As for I like the |
To get a sense of what should be in a Racket library, I tried grepping all packages from a January snapshot, where each grep was of the form
These are just rough counts, of course, given the grep approach. A number like 6 means basically unused, except that there are things that track or copy "list.rkt". I read this as confirming that The The The The relative rareness of My current conclusions on what to include:
Further Rhombus discussion probably belongs in the other repo, but I would be inclined to omit |
Would you be happier if functions that split the list into 2 values, such as The index operations like |
As much as I like the treelist datatype, I don't see so many Racket programs moving to them that we need With that in mind, maybe it's best to add only |
cf40fda
to
c0bd1a1
Compare
(treelist-filter odd? (treelist 1 2 3 2 4 5 2)) | ||
(treelist-filter (λ (x) (not (even? x))) (treelist 1 2 3 2 4 5 2)) | ||
(treelist-filter (λ (x) (not (odd? x))) (treelist 1 2 3 2 4 5 2)) | ||
]} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a history
note (and the same for the other additions)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added history notes for 8.15.0.6, the current version. Is that okay, or should this include a version bump to 8.15.0.7?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "8.15.0.6" is good.
@@ -56,6 +56,9 @@ | |||
(regexp-quote (symbol->string 'op)) | |||
":")))) | |||
|
|||
(define-syntax-rule (test-values expected actual) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this is not used, anymore.
Checklist
Description of change
Adds 5 new treelist functions:
treelist-filter
: like listfilter
treelist-index-of
: like listindex-of
treelist-flatten
: like listflatten
treelist-append*
: like listappend*
on one argumentsequence->treelist
: like listsequence->list