[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Dec 22 21:58:32 2001 
Subject:Re: Have I hit a bug already? 
From:Pete Goodeve 
Volume-ID:1011222.02 

In article <3C234E18.68CF@ed.ac.uk>,
Stephen Isard  <S.IsardDeleteThis@ed.ac.uk> wrote:
>                                       
>Well, you could do
>
>define echo();
>	until dup(cucharin()) = termin then enduntil;
>	.erase; ;;; don't include termin in the string
>	consstring(stacklength())->str;
>enddefine;
>

Umm.  That won't be very good if something is already on the stack
when echo() is called, will it?

After some more reading I came across this idiom, which -- although
it still uses temp -- seems much the cleanest:

define echo();
	lvars temp;
	''->str;
	until (cucharin()->>temp) = termin do
	str><consstring(temp, 1)->str;
	enduntil;
enddefine;


I think I'll shut up for a while now.  I keep on coming up with more 
questions, but I should probably try to answer them myself first. (:-))

Cheers,
					-- Pete --