rfc:array_part
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:array_part [2012/05/14 10:58] – [Specification for the function] cataphract | rfc:array_part [2012/05/21 19:24] – Added Comments Section and a comment. lynch | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Request for Comments: array_part ====== | ====== Request for Comments: array_part ====== | ||
- | * Version: 1.0 | + | * Version: 1.1 |
* Date: 2012-05-14 | * Date: 2012-05-14 | ||
* Author: Gustavo Lopes < | * Author: Gustavo Lopes < | ||
Line 34: | Line 34: | ||
An index //i// has the following meaning: | An index //i// has the following meaning: | ||
* If '' | * If '' | ||
- | * If '' | + | * If '' |
* If '' | * If '' | ||
+ | |||
+ | The keys in the original array are not preserved in the output, expect at levels that were not visited. References are preserved. | ||
This function shall return '' | This function shall return '' | ||
Line 42: | Line 44: | ||
* Giving malformed part specifications (where the individual elements do not follow the syntactic rules given here). | * Giving malformed part specifications (where the individual elements do not follow the syntactic rules given here). | ||
* Specifying an part index than does not exist at at least of the elements at the level the part refers to: (e.g. '' | * Specifying an part index than does not exist at at least of the elements at the level the part refers to: (e.g. '' | ||
- | * Giving a part specification with levels that do not exist in the input. This does not apply if, as a result of a span part that comprises all the elements of that level and at the level before | + | * Giving a part specification with levels that do not exist in the input. This does not apply if, as a result of a span part that comprises all the elements of that level and at the level before |
- | * Encountering already visited array elements from the original array (recursion). | + | |
- | ===== Sample implementation and usage ===== | + | ===== Proposed implementation ===== |
+ | |||
+ | The proposed implementation is available as [[https:// | ||
+ | |||
+ | ===== Sample | ||
A sample implementation, | A sample implementation, | ||
+ | |||
+ | This implementation differs in some respects to the internal implementation with respect to behavior. Its purpose is only to exemplify the usage of the function here proposed. | ||
[[https:// | [[https:// | ||
+ | |||
+ | ===== Comments ===== | ||
+ | I would find this far more useful if the keys were preserved, or at least an option to do so. | ||
+ | Or the old standby that INT keys get renumbered but non-INT do not. | ||
+ | |||
===== Objections ===== | ===== Objections ===== | ||
Line 70: | Line 82: | ||
* 2012-05-14 Initial version | * 2012-05-14 Initial version | ||
+ | * 2012-05-21 Dropped recursion restriction, | ||
rfc/array_part.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1