]> gitweb.factorcode.org Git - factor.git/commitdiff
use CONSTANT: in extra
authorDoug Coleman <doug.coleman@gmail.com>
Mon, 23 Feb 2009 01:08:45 +0000 (19:08 -0600)
committerDoug Coleman <doug.coleman@gmail.com>
Mon, 23 Feb 2009 01:08:45 +0000 (19:08 -0600)
13 files changed:
extra/benchmark/binary-trees/binary-trees.factor
extra/benchmark/fasta/fasta.factor
extra/benchmark/mandel/colors/colors.factor
extra/benchmark/mandel/params/params.factor
extra/benchmark/nbody/nbody.factor
extra/benchmark/raytracer/raytracer.factor
extra/crypto/aes/aes.factor
extra/crypto/rsa/rsa.factor
extra/curses/curses.factor
extra/curses/ffi/ffi.factor
extra/math/analysis/analysis.factor
extra/opengl/demo-support/demo-support.factor
extra/tetris/game/game.factor

index 8e3918656a42c14614c62c6cedef05a4e0845515..21ff7fbbef048c2da6bce9988ade3b8806e49405 100644 (file)
@@ -23,7 +23,7 @@ M: tree-node item-check
 
 M: f item-check drop 0 ;
 
-: min-depth 4 ; inline
+CONSTANT: min-depth 4
 
 : stretch-tree ( max-depth -- )
     1 + 0 over bottom-up-tree item-check
index 32d35349202f52c98c8744208103ca8395839379..61d9e9fd4316896fc4d4048e1e73f1d10d84dba3 100755 (executable)
@@ -4,11 +4,11 @@ sequences.private benchmark.reverse-complement hints io.encodings.ascii
 byte-arrays specialized-arrays.double ;
 IN: benchmark.fasta
 
-: IM 139968 ; inline
-: IA 3877 ; inline
-: IC 29573 ; inline
-: initial-seed 42 ; inline
-: line-length 60 ; inline
+CONSTANT: IM 139968
+CONSTANT: IA 3877
+CONSTANT: IC 29573
+CONSTANT: initial-seed 42
+CONSTANT: line-length 60
 
 USE: math.private
 
@@ -17,7 +17,7 @@ USE: math.private
 
 HINTS: random fixnum ;
 
-: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA" ; inline
+CONSTANT: ALU "GGCCGGGCGCGGTGGCTCACGCCTGTAATCCCAGCACTTTGGGAGGCCGAGGCGGGCGGATCACCTGAGGTCAGGAGTTCGAGACCAGCCTGGCCAACATGGTGAAACCCCGTCTCTACTAAAAATACAAAAATTAGCCGGGCGTGGTGGCGCGCGCCTGTAATCCCAGCTACTCGGGAGGCTGAGGCAGGAGAATCGCTTGAACCCGGGAGGCGGAGGTTGCAGTGAGCCGAGATCGCGCCACTGCACTCCAGCCTGGGCGACAGAGCGAGACTCCGTCTCAAAAA"
 
 : IUB
     {
index edc848a0caabde94b9f3959382070980d670af05..9e0f2472e27c4c8563cb51d95c0287ab20bf070b 100644 (file)
@@ -7,8 +7,8 @@ IN: benchmark.mandel.colors
 : scale-rgb ( rgba -- n )
     [ red>> scale ] [ green>> scale ] [ blue>> scale ] tri 3byte-array ;
 
-: sat 0.85 ; inline
-: val 0.85 ; inline
+CONSTANT: sat 0.85
+CONSTANT: val 0.85
 
 : <color-map> ( nb-cols -- map )
     dup [
index c40d3c1f2d009863cad01c9139705ee5207b22c3..8a19180d733563fbfa5a06d8a82fee4b0a8dc893 100644 (file)
@@ -1,8 +1,8 @@
 IN: benchmark.mandel.params
 
-: max-color       360   ; inline
-: zoom-fact       0.8   ; inline
-: width           640   ; inline
-: height          480   ; inline
-: max-iterations  40    ; inline
-: center         -0.65  ; inline
+CONSTANT: max-color       360  
+CONSTANT: zoom-fact       0.8  
+CONSTANT: width           640  
+CONSTANT: height          480  
+CONSTANT: max-iterations  40   
+CONSTANT: center         -0.65 
index 37c4fc43c5a8cc5892b760b881832f10572e6356..f72ceb46297301bfe24e933a6d0f89e11b2491c6 100644 (file)
@@ -6,7 +6,7 @@ sequences hints arrays ;
 IN: benchmark.nbody
 
 : solar-mass ( -- x ) 4 pi sq * ; inline
-: days-per-year 365.24 ; inline
+CONSTANT: days-per-year 365.24
 
 TUPLE: body
 { location double-array }
index c16e47846efb16c13f719e8e49d3b1ea4ad850e3..8d07ae1c65f319d81fb78da195d8cfe7864c0e0a 100755 (executable)
@@ -16,13 +16,13 @@ IN: benchmark.raytracer
         0.5345224838248488
     } ; 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 } ;
 
@@ -88,7 +88,7 @@ TUPLE: group < sphere { objs array read-only } ;
 M: group intersect-scene ( hit ray group -- hit )
     [ 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-hit ] 2dip intersect-scene ; inline
index cacfc5971a002367f1fa3e4c9e0d0986e3721ee7..0807420266dd2ace7573f7688c7306907fe40452 100644 (file)
@@ -4,7 +4,7 @@ USING: arrays kernel math memoize sequences math.bitwise
 locals ;
 IN: crypto.aes
 
-: AES_BLOCK_SIZE 16 ; inline
+CONSTANT: AES_BLOCK_SIZE 16
 
 : sbox ( -- array )
 {
index b1eb90754768795da8b18fc4b72d8938121b2bd6..373dd9637c7c811da2a80217218ccad830bc9090 100644 (file)
@@ -18,7 +18,7 @@ C: <rsa> rsa
 
 <PRIVATE
 
-: public-key 65537 ; inline
+CONSTANT: public-key 65537
 
 : rsa-primes ( numbits -- p q )
     2/ 2 unique-primes first2 ;
index f11b26333be1a8f55937b9dd1121cb6a9be89a35..3e466b4781aa6ef1ad798c7192e9f44284391736 100644 (file)
@@ -10,9 +10,9 @@ IN: curses
 SYMBOL: curses-windows
 SYMBOL: current-window
 
-: ERR -1 ; inline
-: FALSE 0 ; inline
-: TRUE 1 ; inline
+CONSTANT: ERR -1
+CONSTANT: FALSE 0
+CONSTANT: TRUE 1
 : >BOOLEAN ( n -- TRUE/FALSE ) >boolean TRUE FALSE ? ; inline
 
 ERROR: duplicate-window window ;
index 8d4a7ddb4bf6a139d097b8c5ad5301ca1590c9f7..b1c481a5769c5333b3ce462ae47c3994f162a250 100644 (file)
@@ -18,7 +18,7 @@ TYPEDEF: chtype attr_t
 TYPEDEF: short NCURSES_SIZE_T
 TYPEDEF: ushort wchar_t
 
-: CCHARW_MAX  5 ; inline
+CONSTANT: CCHARW_MAX  5
 
 C-STRUCT: cchar_t
     { "attr_t" "attr" }
index b5f6a547bac77064cc8c259665e68715842a0fde..9c773f748e6ed34a7a6d1cfc67ed4cc114ff42b7 100755 (executable)
@@ -9,7 +9,7 @@ IN: math.analysis
 ! http://www.rskey.org/gamma.htm  "Lanczos Approximation"
 ! n=6: error ~ 3 x 10^-11
 
-: gamma-g6 5.15 ; inline
+CONSTANT: gamma-g6 5.15
 
 : gamma-p6
     {
index c8fe2b4882a1d9a59ad562664f8987dada4e2086..9f05482b30f75f161d279ccc9ec023a8f8987799 100755 (executable)
@@ -4,8 +4,8 @@ ui.render accessors combinators ;
 IN: opengl.demo-support
 
 : FOV ( -- x ) 2.0 sqrt 1+ ; inline
-: MOUSE-MOTION-SCALE 0.5 ; inline
-: KEY-ROTATE-STEP 10.0 ; inline
+CONSTANT: MOUSE-MOTION-SCALE 0.5
+CONSTANT: KEY-ROTATE-STEP 10.0
 
 SYMBOL: last-drag-loc
 
index ef5ffcc3447c48822931394ac41006132d363b52..00b5bb6c410a8d16d59f19eb47da80b56154b1de 100644 (file)
@@ -12,8 +12,8 @@ TUPLE: tetris
     { paused? initial: f }
     { running? initial: t } ;
 
-: default-width 10 ; inline
-: default-height 20 ; inline
+CONSTANT: default-width 10
+CONSTANT: default-height 20
 
 : <tetris> ( width height -- tetris )
     dupd <board> swap <piece-llist>