CONSTANT: vm-reg 16
CONSTANT: ctx-reg 17
CONSTANT: frame-reg 31
-: nv-int-regs ( -- seq ) 13 31 [a,b] ;
+: nv-int-regs ( -- seq ) 13 31 [a..b] ;
: LOAD32 ( r n -- )
[ -16 shift 0xffff bitand LIS ]
CONSTANT: vm-reg 16
CONSTANT: ctx-reg 17
CONSTANT: frame-reg 31
-: nv-int-regs ( -- seq ) 13 31 [a,b] ;
+: nv-int-regs ( -- seq ) 13 31 [a..b] ;
: LOAD64 ( r n -- )
[ dup ] dip {
: restore-vec ( reg offt -- ) save-at 11 swap LI 11 1 LVXL ;
! Stop using intervals here.
-: nv-fp-regs ( -- seq ) 14 31 [a,b] ;
-: nv-vec-regs ( -- seq ) 20 31 [a,b] ;
+: nv-fp-regs ( -- seq ) 14 31 [a..b] ;
+: nv-vec-regs ( -- seq ) 20 31 [a..b] ;
: saved-fp-regs-size ( -- n ) 144 ;
: saved-vec-regs-size ( -- n ) 192 ;
] unit-test
{ t } [
- 1999 2025 [a,b] [
+ 1999 2025 [a..b] [
<year> timestamp>year-dates-gmt
[ >date< ymd>ordinal ] map [ < ] monotonic?
] map [ ] all?
] unit-test
{ t } [
- 1999 2025 [a,b] [
+ 1999 2025 [a..b] [
<year-gmt> timestamp>year-dates-gmt
[ >date< ymd>ordinal ] map [ < ] monotonic?
] map [ ] all?
{ } [ test-dominance ] unit-test
-{ t } [ 0 4 [a,b] [ get dom-parent 0 get eq? ] all? ] unit-test
+{ t } [ 0 4 [a..b] [ get dom-parent 0 get eq? ] all? ] unit-test
! The other example from the paper
V{ } 0 test-bb
{ } [ test-dominance ] unit-test
-{ t } [ 0 5 [a,b] [ get dom-parent 0 get eq? ] all? ] unit-test
+{ t } [ 0 5 [a..b] [ get dom-parent 0 get eq? ] all? ] unit-test
: non-det-test ( -- cfg )
9 <iota> [ V{ } clone over insns>block ] { } map>assoc dup
M: ppc machine-registers
{
- { int-regs $[ 3 12 [a,b] 17 29 [a,b] append ] }
- { float-regs $[ 0 29 [a,b] ] }
+ { int-regs $[ 3 12 [a..b] 17 29 [a..b] append ] }
+ { float-regs $[ 0 29 [a..b] ] }
} ;
M: ppc frame-reg 31 ;
" random-attrs string>random-generator"
" '["
" _ _ _"
- " [ [a,b] random present write ]"
+ " [ [a..b] random present write ]"
" with-random-generator"
" ] [code] ;"
}
}
} [
<image>
- 1 16 [a,b] >byte-array >>bitmap
+ 1 16 [a..b] >byte-array >>bitmap
{ 4 4 } >>dim
L >>component-order
ubyte-components >>component-type
}
} [
<image>
- 1 9 [a,b] >byte-array >>bitmap
+ 1 9 [a..b] >byte-array >>bitmap
{ 3 3 } >>dim
L >>component-order
ubyte-components >>component-type
! Check sieve array length logic by making sure we get the right
! end-point for numbers with all possibilities mod 30. If something
! were to go wrong, we'd get a bounds-error.
-{ } [ 2 100 [a,b] [ dup sieve marked-prime? drop ] each ] unit-test
+{ } [ 2 100 [a..b] [ dup sieve marked-prime? drop ] each ] unit-test
{ t } [
{ 2 3 5 7 11 13 } 100 sieve '[ _ marked-prime? ] all?
_ [ [
_ new
[ [ length <iota> ] keep like ]
- [ [ length dup dup + [a,b) ] keep like ] bi [ ] 2sequence
+ [ [ length dup dup + [a..b) ] keep like ] bi [ ] 2sequence
] dip '[ _ vshuffle2-elements ] ]
[ = ] check-optimizer
] unit-test
: random-string ( -- str )
1000000 random ;
- ! [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+ ! [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
: random-assocs ( n -- hash phash )
[ random-string ] replicate
<PRIVATE
-CONSTANT: ascii-printable-charset $[ 33 126 [a,b] ]
+CONSTANT: ascii-printable-charset $[ 33 126 [a..b] ]
CONSTANT: hex-charset "0123456789ABCDEF"
CONSTANT: alphanum-charset $[
- CHAR: 0 CHAR: 9 [a,b]
- CHAR: a CHAR: z [a,b] append
- CHAR: A CHAR: Z [a,b] append ]
+ CHAR: 0 CHAR: 9 [a..b]
+ CHAR: a CHAR: z [a..b] append
+ CHAR: A CHAR: Z [a..b] append ]
PRIVATE>
)
! DPI_AWARENESS_CONTEXT experimentally:
-! USE: math.ranges -100 1000 [a,b] [ <alien> IsValidDpiAwarenessContext ] zip-with
+! USE: math.ranges -100 1000 [a..b] [ <alien> IsValidDpiAwarenessContext ] zip-with
! [ nip 0 > ] assoc-filter keys .
! { -5 -4 -3 -2 -1 17 18 34 273 529 785 }
" [ + 30 = ] [ 4 * swap 2 * + 74 = ] 2bi and ;"
""
"["
- " 1 30 [a,b] amb 1 30 [a,b] amb"
+ " 1 30 [a..b] amb 1 30 [a..b] amb"
" [ check must-be-true ] [ 2array ] 2bi"
"] bag-of ."
"V{ { 23 7 } }"
" [ + 30 = ] [ 4 * swap 2 * + 74 = ] 2bi and ;"
""
"["
- " 1 30 [a,b] amb 1 30 [a,b] amb"
+ " 1 30 [a..b] amb 1 30 [a..b] amb"
" 2dup check must-be-true"
" \"%d chickens, %d cows\\n\" printf"
" t"
<<
CONSTANT: ALPHANUMERIC $[
[
- CHAR: a CHAR: z [a,b] %
- CHAR: A CHAR: Z [a,b] %
- CHAR: 0 CHAR: 9 [a,b] %
+ CHAR: a CHAR: z [a..b] %
+ CHAR: A CHAR: Z [a..b] %
+ CHAR: 0 CHAR: 9 [a..b] %
".-_~" %
] { } make
]
! Random salt is formed by ascii characters
! between 33 and 126
CONSTANT: available-chars $[
- CHAR: : 33 126 [a,b] remove >byte-array
+ CHAR: : 33 126 [a..b] remove >byte-array
]
PRIVATE>
IN: imap.tests
: random-ascii ( n -- str )
- [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+ [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
: make-mail ( from -- mail )
now timestamp>rfc822 swap 10000 random
1/0. 1/105 1/0. -1/15 1/0. 1/3 1/0. -1 1/0.
1 1 1 2 3 8 15 48 105 384 945 3840
}
-} [ -10 10 [a,b] [ double-factorial ] map ] unit-test
+} [ -10 10 [a..b] [ double-factorial ] map ] unit-test
{ 1 } [ 10 10 factorial/ ] unit-test
{ 720 } [ 10 7 factorial/ ] unit-test
] unit-test
: long-string ( -- x )
- 10000 [ CHAR: a CHAR: z [a,b] random ] "" replicate-as ;
+ 10000 [ CHAR: a CHAR: z [a..b] random ] "" replicate-as ;
! Performance
{ 0 } [ long-string ".{0,15}foobar.{0,10}" findall length ] unit-test
{ f } [ 99 test-tree2 lower-node ] unit-test
{ f } [ 100 test-tree2 lower-node ] unit-test
-100 121 (a,b] [
+100 121 (a..b] [
[ test-tree2-lower-key 1array ] keep [ test-tree2 lower-node key>> ] curry unit-test
] each
-99 120 [a,b) [
+99 120 [a..b) [
[ test-tree2-higher-key 1array ] keep [ test-tree2 higher-node key>> ] curry unit-test
] each
{ f } [ 120 test-tree2 higher-node ] unit-test
{ f } [ 121 test-tree2 higher-node ] unit-test
{ f } [ 99 test-tree2 floor-node ] unit-test
-100 121 [a,b] [
+100 121 [a..b] [
[ test-tree2-floor-key 1array ] keep [ test-tree2 floor-node key>> ] curry unit-test
] each
-99 120 [a,b] [
+99 120 [a..b] [
[ test-tree2-ceiling-key 1array ] keep [ test-tree2 ceiling-node key>> ] curry unit-test
] each
{ f } [ 121 test-tree2 ceiling-node ] unit-test
: ?a,b? ( a b ? ? -- range )
2array {
- { { t t } [ [a,b] ] }
- { { t f } [ [a,b) ] }
- { { f t } [ (a,b] ] }
- { { f f } [ (a,b) ] }
+ { { t t } [ [a..b] ] }
+ { { t f } [ [a..b) ] }
+ { { f t } [ (a..b] ] }
+ { { f f } [ (a..b) ] }
} case ;
! subtree>alist
{ { f f } [ subtree>alist() ] }
} case ;
-99 121 [a,b] 2 all-combinations
+99 121 [a..b] 2 all-combinations
{ t f } dup 2array <product-sequence> 2array
[ first2 [ first2 ] bi@
{