From: Chris Siebenmann <cks>
To: rc
Subject: Re: Thoughts on a builtin read
Date: Tue, 21 Sep 1993 13:02:04 -0400 [thread overview]
Message-ID: <93Sep21.130210edt.2689@hawkwind.utcs.toronto.edu> (raw)
In-Reply-To: malte's message of Tue, 21 Sep 93 11:56:15 -0400. <9309211556.AA20736@dahlie.techfak.uni-bielefeld.de>
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=$* } }
]
next prev parent reply other threads:[~1993-09-21 17:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
1993-09-21 15:56 malte
1993-09-21 17:02 ` Chris Siebenmann [this message]
-- strict thread matches above, loose matches on Subject: below --
1993-09-22 17:18 Steve_Kilbane
1993-09-21 17:26 Arnold Robbins
1993-09-21 17:11 rsalz
1993-09-21 16:58 Arnold Robbins
1993-09-21 16:52 gjv%atlas%cesar
1993-09-21 16:36 Byron Rakitzis
1993-09-21 16:50 ` Chris Siebenmann
1993-09-21 15:54 Tom Culliton x2278
1993-09-21 15:15 Alan Watson
1993-09-21 15:09 rsalz
1993-09-21 14:33 malte
1993-09-21 14:20 rsalz
1993-09-21 6:51 malte
1993-09-21 14:19 ` Chris Siebenmann
1993-09-20 22:11 Tom Culliton x2278
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=93Sep21.130210edt.2689@hawkwind.utcs.toronto.edu \
--to=rc@hawkwind.utcs.toronto.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).