If you want to avoid those dynamic type checks and not use TYPED, another 
alternative is "declare":

    { object array fixnum } declare



> On Jan 25, 2015, at 9:12 AM, Björn Lindqvist <bjou...@gmail.com> wrote:
> 
> 2015-01-18 2:44 GMT+00:00 John Benediktsson <mrj...@gmail.com>:
>> Also, minor comment, instead of:
>> 
>>    length [ 0 ] { } replicate-as ;
>> 
>> You can just do:
>> 
>>    length 0 <array>
> 
> Thanks!
> 
>> And instead of the array-nth stuff, you can just do some type declarations
>> and the compiler should make it the same as your array words:
>> 
>>    { fixnum array } declare nth-unsafe ;
>> 
>>    { array } declare first2-unsafe ;
> 
> Oh of course. When I wrote the code I was trying to stay stay close to
> the metal and tell Factor exactly what code it should generate. Even
> if it figures it out equally well on its own anyway.
> 
>> I recommend using TYPED: or TYPED:: declarations to specify neighbors is an
>> array and normal sequence words?
> 
> I was trying that, but Factor appears to add dynamic type checks to
> words which call typed words which increase the size of the generated
> code.
> 
> 
> -- 
> mvh/best regards Björn Lindqvist
> 
> ------------------------------------------------------------------------------
> New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
> GigeNET is offering a free month of service with a new server in Ashburn.
> Choose from 2 high performing configs, both with 100TB of bandwidth.
> Higher redundancy.Lower latency.Increased capacity.Completely compliant.
> http://p.sf.net/sfu/gigenet
> _______________________________________________
> Factor-talk mailing list
> Factor-talk@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/factor-talk

------------------------------------------------------------------------------
New Year. New Location. New Benefits. New Data Center in Ashburn, VA.
GigeNET is offering a free month of service with a new server in Ashburn.
Choose from 2 high performing configs, both with 100TB of bandwidth.
Higher redundancy.Lower latency.Increased capacity.Completely compliant.
http://p.sf.net/sfu/gigenet
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to