Skip to content

Commit

Permalink
CHANGE: don't allow binary input for set operations (does not work an…
Browse files Browse the repository at this point in the history
…yway)

related to: Oldes/Rebol-issues#1978
  • Loading branch information
Oldes committed Sep 23, 2022
1 parent 707c373 commit 2b53189
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
18 changes: 9 additions & 9 deletions src/boot/natives.reb
Original file line number Diff line number Diff line change
Expand Up @@ -453,43 +453,43 @@ entab: native [

difference: native [
{Returns the special difference of two values.}
set1 [block! string! binary! bitset! date! typeset! map!] "First data set"
set2 [block! string! binary! bitset! date! typeset! map!] "Second data set"
set1 [block! string! bitset! date! typeset! map!] "First data set"
set2 [block! string! bitset! date! typeset! map!] "Second data set"
/case {Uses case-sensitive comparison}
/skip {Treat the series as records of fixed size}
size [integer!]
]

exclude: native [
{Returns the first data set less the second data set.}
set1 [block! string! binary! bitset! typeset! map!] "First data set"
set2 [block! string! binary! bitset! typeset! map!] "Second data set"
set1 [block! string! bitset! typeset! map!] "First data set"
set2 [block! string! bitset! typeset! map!] "Second data set"
/case {Uses case-sensitive comparison}
/skip {Treat the series as records of fixed size}
size [integer!]
]

intersect: native [
{Returns the intersection of two data sets.}
set1 [block! string! binary! bitset! typeset! map!] "first set"
set2 [block! string! binary! bitset! typeset! map!] "second set"
set1 [block! string! bitset! typeset! map!] "first set"
set2 [block! string! bitset! typeset! map!] "second set"
/case {Uses case-sensitive comparison}
/skip {Treat the series as records of fixed size}
size [integer!]
]

union: native [
{Returns the union of two data sets.}
set1 [block! string! binary! bitset! typeset! map!] "first set"
set2 [block! string! binary! bitset! typeset! map!] "second set"
set1 [block! string! bitset! typeset! map!] "first set"
set2 [block! string! bitset! typeset! map!] "second set"
/case {Use case-sensitive comparison}
/skip {Treat the series as records of fixed size}
size [integer!]
]

unique: native [
{Returns the data set with duplicates removed.}
set1 [block! string! binary! bitset! typeset! map!]
set1 [block! string! bitset! typeset! map!]
/case {Use case-sensitive comparison (except bitsets)}
/skip {Treat the series as records of fixed size}
size [integer!]
Expand Down
8 changes: 5 additions & 3 deletions src/core/n-sets.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ enum {
RESET_TAIL(retser); // required - allow reuse
break;

case REB_BINARY:
cased = TRUE;
SET_TYPE(D_RET, REB_BINARY);
//case REB_BINARY:
//!! Binary input is broken, so better to turn it of for now! !!//
//!! https://github.com/Oldes/Rebol-issues/issues/1978 !!//
// cased = TRUE;
// SET_TYPE(D_RET, REB_BINARY);
case REB_STRING:
i = VAL_LEN(val1);
// Setup result block:
Expand Down

0 comments on commit 2b53189

Please # to comment.