rc-list - mailing list for the rc(1) shell
 help / color / mirror / Atom feed
From: Alan Watson <alan@oldp.astro.wisc.edu>
To: rc@hawkwind.utcs.toronto.edu
Subject: lazy auto-loading of functions
Date: Wed, 19 May 1993 00:40:46 -0400	[thread overview]
Message-ID: <9305190440.AA03713@oldp.astro.wisc.edu> (raw)

Jealous of Paul Haahr's beautiful implementation of lazy auto-loading of
functions in es, I tried to do something similar in rc (which I'm still
using as my everyday shell).  Obviously, one cannot use his approach
directly, but one can go some of the way to reducing the size of the
environment as follows:

fnlib = $home/fn
fn load { builtin . $fnlib/$1 }
builtin cd $fnlib
name = () for ( name in * ) fn $name { load $0 && $0 $* }
builtin cd

This is just what you need for those rarely used but sometimes essential
functions.

Alan.


             reply	other threads:[~1993-05-19  4:40 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1993-05-19  4:40 Alan Watson [this message]
1993-05-19 17:39 Erik Quanstrom
1993-05-19 18:05 Alan Watson

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=9305190440.AA03713@oldp.astro.wisc.edu \
    --to=alan@oldp.astro.wisc.edu \
    --cc=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).