Re: Python as standard shell? was Re: [RFC] Draft Proposal

Jim Roskind (jar@infoseek.com)
Wed, 1 Jun 1994 14:21:55 -0700

> From: gary@cs.su.oz.au (Gary Capell)
> Date: 30 May 1994 02:50:18 +1000
>
> jw@ibch50.inf.tu-dresden.de (Wittenberger) writes:
> > I would like python to be the standard shell of a planned system.
>
> I thought python would be nice to use as a shell when I first came
> across it (currently use rc), and do use it for scripts (doctype, news
> reader). However, having to type 'ls()' instead of 'ls' drove me batty
> almost immediately, so I gave up on the idea of using python as my
> interactive shell.

It is interesting to note that IF ONLY this were the only thing
stopping you, you *could* work around this problem with a bit of
hackery. The *trick* would be to define an object with an
"interesting" __repr__ function. You could then type:

ls

and get the repr of such an object, which would coincidentally be a
directory listing for the "current" directory :-).

The distinction between function calls and values (or lack thereof) is
interesting in many languages. The repr functions for a class gives a
hint at some of this stuff, but does not completely open pandoras
box. ;-) I often puzzle over related issues when access methods are
compared with "direct" access to member values.

Jim

Jim Roskind
408-982-4469
jar@infoseek.com