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

WISH: possibility to enquire the element properties of vector! values #2353

Closed
Siskin-Bot opened this issue Feb 15, 2020 · 0 comments
Closed
Labels
Datatype: vector! Oldes.resolved Bugs/wishes with Oldes' fixes/features Test.written

Comments

@Siskin-Bot
Copy link
Collaborator

Submitted by: Oldes

vector! values have an element type (integer! and decimal! so far) and a bit-size (8 16 32 or 64). Integers also may be unsigned. Currently the only way to find the actual properties from a given vector value is to mold the value and parse the resulting string.


Imported from: metaeducation#2352

Comments:

Oldes added a commit to Oldes/Rebol3 that referenced this issue on Jan 18, 2019:
FEAT: CHANGE: possibility to enquire the element properties of vector…


Oldes commented on Jan 18, 2019:

Above commit should be enough for accessing vector properties. I'm just not sure with the length. Now it reports complete length (not counting with possibly changed index:

>> spec-of probe make vector! [integer! 8 4]
make vector! [integer! 8 4 [0 0 0 0]]
== [integer! 8 4]

>> spec-of probe skip make vector! [integer! 8 4] 2
make vector! [integer! 8 2 [0 0]]
== [integer! 8 4]

versus:

>> length? make vector! [integer! 8 4]
== 4

>> length? skip make vector! [integer! 8 4] 2
== 2

Is it ok?


Hostilefork added the Datatype.vector on Jan 24, 2019


@Siskin-Bot Siskin-Bot added Datatype: vector! Oldes.resolved Bugs/wishes with Oldes' fixes/features labels Feb 15, 2020
@Oldes Oldes closed this as completed Apr 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Datatype: vector! Oldes.resolved Bugs/wishes with Oldes' fixes/features Test.written
Projects
None yet
Development

No branches or pull requests

2 participants