Austin Hastings writes:
 > 
 > On the other hand, let's suppose that you've got a vast array of
 > floating point data:
 > 
 > my float @seti = {...evidence of intelligence, somewhere...};
 > 
 > It's a fair question to ask how to retarget the rexengine to use @seti
 > as the input stream. (I hereby declare that if anyone ever writes a
 > grammar to do stock-picking, I thunk it first! :-)
 > 
 > I'm guessing that the right way is to replace the low-level operators,
 > but what are they?
 > 
 > >  rule color { (.) <( $1.isa(Colorific) )> }
 > >  $daylight = &peek_at_sky =~ /<color>/; # is something in sky
 > > Colorific?
 > 
 > Alternatively, there may be a lower-level "stream" object that could be
 > replaced:
 > 
 > grammar Rainbow
 > {
 >   let &Rex::get_one := &read_float_from_array;
 > 
 >   # ...
 > }
 > 

I think this was already discussed once and then it was proposed to 
attach a property to characters of the string 

 sub peek_at_sky {
     
     my Color  @numbers = peek_with_some_hardware; 

     my $say_it =  join map { "1" but color($_) } @numbers ; 
     return $say_it ; 
 }    


   rule color { (.) { let $0 := $1.color } }   

   $daylight = &peek_at_sky =~ /<color>+/; # is something in sky
 


arcadi 
       

Reply via email to