-
Notifications
You must be signed in to change notification settings - Fork 80
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
SIP specifying Clarity slice
function
#76
Comments
slice
functionslice
function
Can this be closed now with SIP-015? |
You may consider leaving it open as a candidate improvement for the next version of Clarity. The alternative design with last argument being the length of the result sequence offers a compelling alternative to the contrived expressions that typically results from the For example, consider this expression to just take the first three elements "abc" from a string while having the result properly typed as a (string-ascii 3): (unwrap-panic (as-max-len? (default-to (list) (slice? "abcdef" 0 3)) u3)) With the proposed (slice "abcdef" 0 3) |
Yes it can.
Please open a specific issue for an alternative |
I propose a SIP to specify a
slice
function for Clarity, building on the proposal in clarity-lang/reference#42 expanded with the insights of stacks-network/stacks-core#3149. There is a prototype implementation of such a function in the next branch that can be improved on.The text was updated successfully, but these errors were encountered: