use CONSTANT: in extra

db4
Doug Coleman 2009-02-22 19:08:45 -06:00
parent 2f868b38c2
commit e026b554a9
13 changed files with 32 additions and 32 deletions

View File

@ -23,7 +23,7 @@ M: tree-node item-check
M: f item-check drop 0 ; M: f item-check drop 0 ;
: min-depth 4 ; inline CONSTANT: min-depth 4
: stretch-tree ( max-depth -- ) : stretch-tree ( max-depth -- )
1 + 0 over bottom-up-tree item-check 1 + 0 over bottom-up-tree item-check

View File

@ -4,11 +4,11 @@ sequences.private benchmark.reverse-complement hints io.encodings.ascii
byte-arrays specialized-arrays.double ; byte-arrays specialized-arrays.double ;
IN: benchmark.fasta IN: benchmark.fasta
: IM 139968 ; inline CONSTANT: IM 139968
: IA 3877 ; inline CONSTANT: IA 3877
: IC 29573 ; inline CONSTANT: IC 29573
: initial-seed 42 ; inline CONSTANT: initial-seed 42
: line-length 60 ; inline CONSTANT: line-length 60
USE: math.private USE: math.private
@ -17,7 +17,7 @@ USE: math.private
HINTS: random fixnum ; HINTS: random fixnum ;
: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" ; inline CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
: IUB : IUB
{ {

View File

@ -7,8 +7,8 @@ IN: benchmark.mandel.colors
: scale-rgb ( rgba -- n ) : scale-rgb ( rgba -- n )
[ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ; [ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ;
: sat 0.85 ; inline CONSTANT: sat 0.85
: val 0.85 ; inline CONSTANT: val 0.85
: <color-map> ( nb-cols -- map ) : <color-map> ( nb-cols -- map )
dup [ dup [

View File

@ -1,8 +1,8 @@
IN: benchmark.mandel.params IN: benchmark.mandel.params
: max-color 360 ; inline CONSTANT: max-color 360
: zoom-fact 0.8 ; inline CONSTANT: zoom-fact 0.8
: width 640 ; inline CONSTANT: width 640
: height 480 ; inline CONSTANT: height 480
: max-iterations 40 ; inline CONSTANT: max-iterations 40
: center -0.65 ; inline CONSTANT: center -0.65

View File

@ -6,7 +6,7 @@ sequences hints arrays ;
IN: benchmark.nbody IN: benchmark.nbody
: solar-mass ( -- x ) 4 pi sq * ; inline : solar-mass ( -- x ) 4 pi sq * ; inline
: days-per-year 365.24 ; inline CONSTANT: days-per-year 365.24
TUPLE: body TUPLE: body
{ location double-array } { location double-array }

View File

@ -16,13 +16,13 @@ IN: benchmark.raytracer
0.5345224838248488 0.5345224838248488
} ; inline } ; inline
: oversampling 4 ; inline CONSTANT: oversampling 4
: levels 3 ; inline CONSTANT: levels 3
: size 200 ; inline CONSTANT: size 200
: delta 1.4901161193847656E-8 ; inline CONSTANT: delta 1.4901161193847656E-8
TUPLE: ray { orig double-array read-only } { dir double-array read-only } ; TUPLE: ray { orig double-array read-only } { dir double-array read-only } ;
@ -88,7 +88,7 @@ TUPLE: group < sphere { objs array read-only } ;
M: group intersect-scene ( hit ray group -- hit ) M: group intersect-scene ( hit ray group -- hit )
[ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ; [ drop objs>> [ intersect-scene ] with each ] if-ray-sphere ;
: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. } ; inline CONSTANT: initial-hit T{ hit f double-array{ 0.0 0.0 0.0 } 1/0. }
: initial-intersect ( ray scene -- hit ) : initial-intersect ( ray scene -- hit )
[ initial-hit ] 2dip intersect-scene ; inline [ initial-hit ] 2dip intersect-scene ; inline

View File

@ -4,7 +4,7 @@ USING: arrays kernel math memoize sequences math.bitwise
locals ; locals ;
IN: crypto.aes IN: crypto.aes
: AES_BLOCK_SIZE 16 ; inline CONSTANT: AES_BLOCK_SIZE 16
: sbox ( -- array ) : sbox ( -- array )
{ {

View File

@ -18,7 +18,7 @@ C: <rsa> rsa
<PRIVATE <PRIVATE
: public-key 65537 ; inline CONSTANT: public-key 65537
: rsa-primes ( numbits -- p q ) : rsa-primes ( numbits -- p q )
2/ 2 unique-primes first2 ; 2/ 2 unique-primes first2 ;

View File

@ -10,9 +10,9 @@ IN: curses
SYMBOL: curses-windows SYMBOL: curses-windows
SYMBOL: current-window SYMBOL: current-window
: ERR -1 ; inline CONSTANT: ERR -1
: FALSE 0 ; inline CONSTANT: FALSE 0
: TRUE 1 ; inline CONSTANT: TRUE 1
: >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline : >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline
ERROR: duplicate-window window ; ERROR: duplicate-window window ;

View File

@ -18,7 +18,7 @@ TYPEDEF: chtype attr_t
TYPEDEF: short NCURSES_SIZE_T TYPEDEF: short NCURSES_SIZE_T
TYPEDEF: ushort wchar_t TYPEDEF: ushort wchar_t
: CCHARW_MAX 5 ; inline CONSTANT: CCHARW_MAX 5
C-STRUCT: cchar_t C-STRUCT: cchar_t
{ "attr_t" "attr" } { "attr_t" "attr" }

View File

@ -9,7 +9,7 @@ IN: math.analysis
! http://www.rskey.org/gamma.htm "Lanczos Approximation" ! http://www.rskey.org/gamma.htm "Lanczos Approximation"
! n=6: error ~ 3 x 10^-11 ! n=6: error ~ 3 x 10^-11
: gamma-g6 5.15 ; inline CONSTANT: gamma-g6 5.15
: gamma-p6 : gamma-p6
{ {

View File

@ -4,8 +4,8 @@ ui.render accessors combinators ;
IN: opengl.demo-support IN: opengl.demo-support
: FOV ( -- x ) 2.0 sqrt 1+ ; inline : FOV ( -- x ) 2.0 sqrt 1+ ; inline
: MOUSE-MOTION-SCALE 0.5 ; inline CONSTANT: MOUSE-MOTION-SCALE 0.5
: KEY-ROTATE-STEP 10.0 ; inline CONSTANT: KEY-ROTATE-STEP 10.0
SYMBOL: last-drag-loc SYMBOL: last-drag-loc

View File

@ -12,8 +12,8 @@ TUPLE: tetris
{ paused? initial: f } { paused? initial: f }
{ running? initial: t } ; { running? initial: t } ;
: default-width 10 ; inline CONSTANT: default-width 10
: default-height 20 ; inline CONSTANT: default-height 20
: <tetris> ( width height -- tetris ) : <tetris> ( width height -- tetris )
dupd <board> swap <piece-llist> dupd <board> swap <piece-llist>