Re: [Factor-talk] CONSTANT:s - foldable, flushable?

2016-05-25 Thread Alexander Ilin
Hello, John! 25.05.2016, 17:54, "John Benediktsson" :One way to work around dependencies like that is to use nested compilation units: << CONSTANT: half-bit-size 6 >><< CONSTANT: bit-size $[ 2 half-bit-size * ] >>CONSTANT: cell-height $[ 3 bit-size * ]CONSTANT: cell-width $[ 3

Re: [Factor-talk] CONSTANT:s - foldable, flushable?

2016-05-25 Thread John Benediktsson
One way to work around dependencies like that is to use nested compilation units: << CONSTANT: half-bit-size 6 >> << CONSTANT: bit-size $[ 2 half-bit-size * ] >> CONSTANT: cell-height $[ 3 bit-size * ] CONSTANT: cell-width $[ 3 bit-size * ] That makes those constants immediately available for

Re: [Factor-talk] CONSTANT:s - foldable, flushable?

2016-05-25 Thread Alexander Ilin
Hello! Initially I wanted to define all constants as dependent on each other, as I would do in Delphi or C++: consthalf-bit-size = 6;bit-size = 2 * half-bit-size;cell-height = 3 * bit-size;cell-width = 3 * bit-size; In Factor that didn't work, so I took out the half-bit-size constant into a

Re: [Factor-talk] CONSTANT:s - foldable, flushable?

2016-05-24 Thread John Benediktsson
I don't think you should use foldable and flushable from the sounds of things. Foldable is used mostly to inline a computed value as a literal, and flushable is used to indicate a word without side effects can be optimized by the compiler to not be called if the output is not used. Are you

[Factor-talk] CONSTANT:s - foldable, flushable?

2016-05-24 Thread Alexander Ilin
Hello! I have some CONSTANT: words, which are used in more CONSTANT:s calculated at compile-time: IN: iqlink.const ! Bits are rectangular, their size in pixels is here. ! All other constants are based on this one. CONSTANT: half-bit-size 6 USING: iqlink.const ; IN: iqlink.cell.gadget