9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: trebol@india.com
To: 9fans@9fans.net
Subject: Re: [9fans] rc: null list in concatenation
Date: Tue, 25 Nov 2014 19:37:07 +0000	[thread overview]
Message-ID: <cf7887cbce543b551c2f3d81ed6b8761@india.com> (raw)
In-Reply-To: <CAOw7k5ikT8uCH5xQ2SCqAS3eAC7vZNDAZRt0uTRuWYTN+egh7w@mail.gmail.com>

> maia% (aa bb)=aaaa; echo bbbb
> rc: variable name not singleton!

Interesting, I could expect something like
'(aa bb) = aaaa --> aa=aaaa bb=aaaa'
but of course there is not a concatenation, but an assigment.

> It's a "null list" not a "null string". You can use a null string:
>
> % s=''
> % ls $s^/x
>
> but not a null list (like using null in many lisp list operations, or the
> difference between strcat of nil and strcat of ""):
>
> % s=()
> % ls $s^/x
> rc (-/bin/rc): null list in concatenation
>
> A completely unset variable is a null list. Also, `{...} returns  a list
> (of words) not a string,
> hence the diagnostic in that case.

Yeah... thanks a lot!
So the correct way must bem something like:

a = ('' `{ls file})^test; echo 'this part _is_ executed if file doesn''t exist'

I feel ashamed... The man page is beautifully written, except may be the
'\t\n' notation. Now this is not confusing for me because I've in mind that
Plan9 ignore those escape sequence, but at first with my unix reflexes
that was a problem, and I think it's important to remember those first
steps to improve documentation.

I remember the first time I type.
$ man bash

I had to power off the computer and go to the beach.

trebol.




  reply	other threads:[~2014-11-25 19:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-25  4:24 trebol
2014-11-25  6:08 ` arisawa
2014-11-25  6:56   ` trebol
2014-11-25  8:30     ` arisawa
2014-11-25 10:00       ` Charles Forsyth
2014-11-25 19:37         ` trebol [this message]
     [not found] <fef8ab0af3b38f58c82f797482943532@india.com>
2014-11-25 20:44 ` trebol
2014-11-25 20:47 ` trebol
2014-11-26  6:34 trebol

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=cf7887cbce543b551c2f3d81ed6b8761@india.com \
    --to=trebol@india.com \
    --cc=9fans@9fans.net \
    /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).