Skip to content

Commit

Permalink
FEAT: Include minimum and maximum results when requested object in a …
Browse files Browse the repository at this point in the history
…query on a vector value
  • Loading branch information
Oldes committed Dec 11, 2024
1 parent 9457bdd commit e11a14b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/boot/sysobj.reb
Original file line number Diff line number Diff line change
Expand Up @@ -489,6 +489,8 @@ standard: object [
type: ; integer! or decimal! so far
size: ; size per value in bits
length: ; number of values
minimum:
maximum:
]

date-info: construct [
Expand Down
2 changes: 2 additions & 0 deletions src/core/t-vector.c
Original file line number Diff line number Diff line change
Expand Up @@ -977,6 +977,8 @@ static void reverse_vector(REBVAL *value, REBCNT len)
Query_Vector_Field(vect, SYM_TYPE, OFV(obj, STD_VECTOR_INFO_TYPE));
Query_Vector_Field(vect, SYM_SIZE, OFV(obj, STD_VECTOR_INFO_SIZE));
Query_Vector_Field(vect, SYM_LENGTH, OFV(obj, STD_VECTOR_INFO_LENGTH));
Query_Vector_Field(vect, SYM_MINIMUM, OFV(obj, STD_VECTOR_INFO_MINIMUM));
Query_Vector_Field(vect, SYM_MAXIMUM, OFV(obj, STD_VECTOR_INFO_MAXIMUM));
SET_OBJECT(value, obj);
}
break;
Expand Down
4 changes: 3 additions & 1 deletion src/tests/units/vector-test.r3
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,10 @@ Rebol [
--assert o/type = 'integer!
--assert o/size = 16
--assert o/length = 2
--assert o/minimum = 0
--assert o/maximum = 0
--test-- "QUERY on vector"
--assert [signed type size length] = query v none
--assert [signed type size length minimum maximum] = query v none
--assert [16 integer!] = query v [:size :type]
--assert block? b: query v [signed length]
--assert all [not b/signed b/length = 2]
Expand Down

0 comments on commit e11a14b

Please sign in to comment.