Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search

[REBOL] A bug in file port? Re:

From: rebol::techscribe::com at: 18-Sep-2000 14:50

Hi Geo, you're doing great! You overlooked one little detai: replace
>> head fp
>>fp: head fp
The head function RETURNS the same port whose current position is at the head of the port. It does not modify the current position of its argument! Hope this helps, At 02:18 PM 9/18/00 -0700, you wrote:
>As per Core User's Guide 2.2.0, on "Ports Access to Files" page >at section "Line Access", I tried as follows: > >>> fp: open/lines %file.txt >>> print first fp >I wanted the gold, and I got it -- >>> forall fp [if find first fp "gold" [print first fp]] >I wanted the gold, and I got it -- > And somehow the gold isn't all. >== false >>> > >All seems going well. > >For my curiosity, I repeated the last statement: > >>> forall fp [if find first fp "gold" [print first fp]] >== none > >Opps. fp must be at its tail. >So, I tried: > >>> tail? fp >== true >>> head fp >>> head? fp >== false > >It puzzled me! Is it a bug or is it me? > >I am still relatively new to REBOL in spite of my lonnnng >experience in programming. > >Geo Massar >Veteran programmer >
;- Elan [ : - ) ] author of REBOL: THE OFFICIAL GUIDE REBOL Press: The Official Source for REBOL Books visit me at