From: Joe M <joe9mail@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] man rc patch
Date: Sun, 11 Nov 2018 10:14:11 -0700 [thread overview]
Message-ID: <20181111171411.GA8793@master> (raw)
In-Reply-To: <1541935934.1883208.1572931672.480E2ACD@webmail.messagingengine.com>
> On Sun, Nov 11, 2018, at 6:59 AM, Alex Musolino wrote:
> > Why not just fix it? This patch [1] seems to do the trick for me.
> >
> > Perhaps also worth mentioning is that $"1 is redundant, since $#1 is
> > always 1; just say $1.
Thanks for the patch.
> why add code to support something which doesn't make sense? :) i thought it was a bug years ago, but then i realised there is no need for it. unlike the bourne shell, rc doesn't have an obsession with breaking up strings. once you've got a string in a variable, it's not going to be split again unless passed to eval. in fact, supporting $"1 could be said to be deceitful, hiding this great feature from newcomers. ;)
I am trying to avoid the 'rc: null list in evaluation' messages when
using $1 when there is no first argument.
The $"1 outputs a blank string instead of failing with that error
message.
Thanks
#!/bin/rc
fn t{
echo '$1 is' $1
echo '$"1 is' $"1
echo '$#1 is' $#1
echo '$2 is' $2
echo '$"2 is' $"2
echo '$#2 is' $#2
echo 'testing concatenation of $1 '$2
}
t 100
; rc /tmp/test.rc
$1 is 100
$"1 is
$#1 is 1
$2 is
$"2 is
$#2 is 0
rc: null list in concatenation
;
next prev parent reply other threads:[~2018-11-11 21:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-11 6:59 Alex Musolino
2018-11-11 11:32 ` Ethan Gardener
2018-11-11 17:14 ` Joe M [this message]
2018-11-11 17:16 ` Joe M
2018-11-14 15:56 ` Ethan Gardener
2018-11-15 18:00 cinap_lenrek
2018-11-15 19:17 cinap_lenrek
2018-11-16 0:47 Alex Musolino
2018-11-16 7:32 cinap_lenrek
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=20181111171411.GA8793@master \
--to=joe9mail@gmail.com \
--cc=9front@9front.org \
/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).