zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <pws@csr.com>
To: Zsh hackers list <zsh-workers@sunsite.dk>
Subject: Re: [PATCH] Proposal: stat -> zstat
Date: Wed, 09 May 2007 18:47:15 +0100	[thread overview]
Message-ID: <200705091747.l49HlF1x026040@news01.csr.com> (raw)
In-Reply-To: <070509101921.ZM12391@torch.brasslantern.com>

Bart Schaefer wrote:
> This is also related to the question of whether a module feature can
> represent a collection of things.  Could
> 
>   zmodload -Fa zsh/nosh turtleteeth
> 
> mean e.g. "autoload anything related to turtleteeth"?  I suppose that
> would mean loading zsh/nosh immediately, but with everything disabled,
> in order to find out what is contained in that feature.  (And then
> unloading it again?  Hrm.)  Or else abstract features are in their
> own category, but then how do you know when to autoload them?  For the
> first pass, or even the second, perhaps abstract features should not
> be auto-loadable.

That last suggestion is likely to be the case.  It's hard to think of a
general mechanism where the shell would know what autoloading an abtract
feature means.  It may be best done (a little like Emacs' hooks) with
a shell function that simply sets up regular autoloads for any concrete
features.

> Which brings up a point:  Previously modules were either all there or
> all not, except insofar as certain bits could be hidden by explicitly
> using "disable" after loading.  With the features change we can get
> into the condition of the module being present, but invisible.

Yes, but there still there to zmodload, so it's detectable.  An option
to unload automatically when all features are disabled isn't difficult,
I don't think; it can be done locally in the main shell's feature
handler.  This should be transparent to future feature requests, and
easy to add later on.

> What happens if both -Fa b:turtleteeth and -ab turtleteeth have been
> executed prior to the first attempt to find turtleteeth?  The easy way
> out is to do the maximal load that has been previously requested.

Yes, that shouldn't be too hard.

> Random possibly unrelated thought:
> We might want to think ahead to the possibilty of module scopes (like
> the local parameter scope).

It's quite hairy to define what the scope is, and also pretty hairy to
implement it since builtins, math functions and conditions don't have a
scope at the moment.

> } Presumably
> } 
> } zmodload -ab zsh/nosh b:fishfingers
> } 
> } should generate an error
> 
> Since ":" isn't valid in an identifier I think that's OK.  (Have we yet
> discussed whether symbolic conditionals like "=~" could be autoloaded?)

That needs some tweaking in the main shell; I vaguely feel leaving
them in the form of -special-tests and not polluting the normal
shell syntax might be preferable.

> I'm actually most concerned with the C definition of the module being
> able to specify dependencies, rather than the user being able to do so
> with some tangled zmodload -d syntax.

Internally this is similar, but deciding what the dependencies actually
are is probably messier in general; since, as I said, we typically
need all of a service module for the next level up this doesn't seem
to arise yet.

-- 
Peter Stephenson <pws@csr.com>                  Software Engineer
CSR PLC, Churchill House, Cambridge Business Park, Cowley Road
Cambridge, CB4 0WZ, UK                          Tel: +44 (0)1223 692070


To access the latest news from CSR copy this link into a web browser:  http://www.csr.com/email_sig.php

To get further information regarding CSR, please visit our Investor Relations page at http://ir.csr.com/csr/about/overview


  reply	other threads:[~2007-05-09 17:47 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-03  5:39 Phil Pennock
2007-05-03  8:50 ` Peter Stephenson
2007-05-06  1:07   ` Phil Pennock
2007-05-06 11:57     ` Peter Stephenson
2007-05-06 14:00       ` Phil Pennock
2007-05-07  0:58         ` Peter Stephenson
2007-05-03 14:48 ` Bart Schaefer
2007-05-03 15:46   ` Peter Stephenson
2007-05-07  5:31     ` Bart Schaefer
2007-05-08 14:40       ` Peter Stephenson
2007-05-09 17:19         ` Bart Schaefer
2007-05-09 17:47           ` Peter Stephenson [this message]
2012-06-29  9:40 4.3.17 unset RPS1 vs RPROMPT Phil Pennock
2012-06-29 10:02 ` Mikael Magnusson
2012-06-29 13:32   ` Phil Pennock
2012-06-29 17:35 ` Bart Schaefer
2012-06-29 18:52 ` Peter Stephenson
2012-06-30  5:05   ` Phil Pennock
2012-06-30 17:31     ` Bart Schaefer
2012-07-01 17:39     ` Peter Stephenson

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=200705091747.l49HlF1x026040@news01.csr.com \
    --to=pws@csr.com \
    --cc=zsh-workers@sunsite.dk \
    /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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

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).