From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from localhost by hawkwind.utcs.toronto.edu with SMTP id <2689>; Tue, 21 Sep 1993 13:02:10 -0400 To: rc Subject: Re: Thoughts on a builtin read In-reply-to: malte's message of Tue, 21 Sep 93 11:56:15 -0400. <9309211556.AA20736@dahlie.techfak.uni-bielefeld.de> Date: Tue, 21 Sep 1993 13:02:04 -0400 From: Chris Siebenmann Message-Id: <93Sep21.130210edt.2689@hawkwind.utcs.toronto.edu> Malte brings up the desire for shift to shift things besides $*. This has been thoroughly beaten to death in the mailing list; see my message <91Sep11.132925edt.2708@hawkwind.utcs.toronto.edu>, which has a supershift function which involves no backquotes and no risk of carefully quoted variables 'escaping'. You can find it in the first mailing list archive on archone.tamu.edu, /pub/rc/rc-list.1991.Z. I highly recommend reading the mailing list archives; many issues have been discussed and summarized there. - cks [to save people's time, here's the function again: # 'supershift' function for rc. # usage: # sshift varname # sshift varname number # shifts the list varname by number (default 1) positions. fn sshift { if (~ $#* 1 ) { _sshift $1 1 $$1 } else { _sshift $1 $2 $$1 } } # this function does most of the work. # _sshift NAME COUNT LISTELEMS # shift LISTELEMS COUNT items left, and assign the result to NAME. fn _sshift { _vn=() { _vn=$1; shift; shift $1; shift; $_vn=$* } } ]