zsh-users
 help / color / mirror / code / Atom feed
* Re: Features of rc and es to zsh
@ 2000-07-21  7:33 Sven Wischnowsky
  0 siblings, 0 replies; 3+ messages in thread
From: Sven Wischnowsky @ 2000-07-21  7:33 UTC (permalink / raw)
  To: zsh-users


Zefram wrote:

> ...
> 
> >Lexically scoped variables     N    N    Y
> 
> This could be done only in a very limited form.  The concepts that give
> lexical scoping are quite alien to Bourne-style shells, and, while some
> of them could be added, without a concept of function objects the utility
> of lexical scoping would be minimal.
> 
> I think the most minimal version of lexical variables -- declared
> variables that become invisible to called functions -- would be useful in
> itself, and reasonably feasible to implement.  Closures (and the nested
> scopes they imply) would be too big a change.

Of course that would be interesting and we already discussed it. And I 
think one day we will have it... maybe we should have added it when we 
started with the new completion system, where it would be very useful
and would have prevented some bugs. Oh well.

Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Features of rc and es to zsh
  2000-07-20 21:59 Juhapekka Tolvanen
@ 2000-07-20 22:32 ` Zefram
  0 siblings, 0 replies; 3+ messages in thread
From: Zefram @ 2000-07-20 22:32 UTC (permalink / raw)
  To: Juhapekka Tolvanen; +Cc: zsh-users

Juhapekka Tolvanen wrote:
>But is that true? Or is that document outdated? If that document is right,
>what and when you zsh-developers are going to do to rectify situation?

Woo.  rc and es are so fundamentally different from zsh that we really
can't adopt all their features.  We certainly aren't going to get
zsh emulating rc -- rc syntax is just so fundamentally different from
sh-type syntax.

>                               zsh  rc   es
>Low level command redefinition N    N    Y

I don't see this happening within zsh's current architecture, nor do I
think that we'd want to.

>Has anonymous functions        N    Y    Y

The sh-style language architecture makes this impossible.  There's just
no concept of a value or an object the way that rc has.  If you want
this kind of feature, use Perl.

>Lexically scoped variables     N    N    Y

This could be done only in a very limited form.  The concepts that give
lexical scoping are quite alien to Bourne-style shells, and, while some
of them could be added, without a concept of function objects the utility
of lexical scoping would be minimal.

I think the most minimal version of lexical variables -- declared
variables that become invisible to called functions -- would be useful in
itself, and reasonably feasible to implement.  Closures (and the nested
scopes they imply) would be too big a change.

>Exceptions                     N    N    Y

Possible, but it'd mean a *lot* of internal changes, and there'd
be visible limitations on the mechanism.  Subshells, being separate
processes, can only return an 8-bit status, so exceptions there wouldn't
be able to propagate into an enclosing shell.  (When writing the Elate
shell I gave it string-valued exceptions, which in addition to being
used as exceptions were also used to implement several other flow control
operations.  In fact, the "return" command was itself a shell function.
This subshell problem exists there and is a documented part of the
shell semantics.)

-zefram


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Features of rc and es to zsh
@ 2000-07-20 21:59 Juhapekka Tolvanen
  2000-07-20 22:32 ` Zefram
  0 siblings, 1 reply; 3+ messages in thread
From: Juhapekka Tolvanen @ 2000-07-20 21:59 UTC (permalink / raw)
  To: zsh-users


Well, it seems that according to this doc shells called es and rc has some
features, that zsh does not have:

http://www.faqs.org/faqs/unix-faq/shell/shell-differences/

                               zsh  rc   es
Low level command redefinition N    N    Y
Has anonymous functions        N    Y    Y
Lexically scoped variables     N    N    Y
Exceptions                     N    N    Y

But is that true? Or is that document outdated? If that document is right,
what and when you zsh-developers are going to do to rectify situation?

-- 
Juhapekka "naula" Tolvanen * U of Jyväskylä * juhtolv@st.jyu.fi
http://www.cc.jyu.fi/~juhtolv/ * * "STRAIGHT BUT NOT NARROW !!" 
---------------------------------------------------------------
"if i was twice the man i could be, i'd still be half of what
you need"                                       Nine Inch Nails


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-07-21  7:34 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-21  7:33 Features of rc and es to zsh Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-07-20 21:59 Juhapekka Tolvanen
2000-07-20 22:32 ` Zefram

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