[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [screen-devel] PATCH: new 'if' primitive
From: |
Micah Cowan |
Subject: |
Re: [screen-devel] PATCH: new 'if' primitive |
Date: |
Tue, 21 Oct 2008 16:34:55 -0700 |
User-agent: |
Thunderbird 2.0.0.17 (X11/20080914) |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Steve Kemp wrote:
> On Tue Oct 21, 2008 at 13:18:41 -0700, Micah Cowan wrote:
>
>> There's plenty of time to discuss it, given that it definitely wouldn't
>> be added for 4.1.0. If Lua support is mature by then, then the obvious
>> solution would be to just use that, instead of inventing something new.
>
> That sounds reasonable. Optimistically I was hoping for a new
> branch, or similar, which could try out some of these changes.
> As things stand I guess I'm going to have to keep maintaining my
> own set of changes which is not ideal, but something I can live
> with.
No, I'll set something up for this soon.
> You're definitely right that with lua support a lot of the things
> I've been doing would be better implemented in it. But I'm assuming
> that like any changes I've suggested any lua integration into
> mainline Screen is going to be in the future.
Right. Definitely not 4.1.0. Maybe 4.2.0, maybe later.
>> Other than that, I'd say that in general it'd be good to emulate shell
>> semantics, both for test-like comparisons and for subshells. Not
>> necessarily full-featured support, but those features we choose to
>> supply should probably mimic Bourne/POSIX syntax.
>
> I think that I've managed to do that now:
>
> if -x file/path ..
> if -d file/path ..
> if -e file/path ..
>
> if $FOO -eq "bar" ..
In usual shell that would be =, not -eq (-eq is for numbers; the reverse
of Perl).
> if `hostname` -eq steve ..
> if `"hostname --fqdn"` -ne "bar" ..
> if "test one" -eq "test two" "echo 'cats and dogs living together'"
It'd also be nifty to support $(...) as well. But that's not crucial.
Also, I'm guessing we're not going to do string interpolation; that is,
unlike shell,
if $FOO = "foo bar"
(note the space) might actually be sensible.
- --
Micah J. Cowan
Programmer, musician, typesetting enthusiast, gamer.
GNU Maintainer: wget, screen, teseq
http://micah.cowan.name/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFI/mcf7M8hyUobTrERAs7OAJ0RZCFRj/+yyvLJvfvxd1dL8sX4swCghm8T
/R/SEiOmNdGgHNaznerrzl0=
=uQjd
-----END PGP SIGNATURE-----