From mboxrd@z Thu Jan 1 00:00:00 1970 From: smiley@zenzebra.mv.com To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> References: <86fwpz55nj.fsf@cmarib.ramside> <257867.782e4d7b.wsc0.mx@tumtum.plumbweb.net> <5ddd9deccbea5e8556dfc0c228b63311@ladd.quanstro.net> <86vcythf8h.fsf@cmarib.ramside> Date: Tue, 5 Apr 2011 17:49:08 +0000 In-Reply-To: (ron minnich's message of "Tue, 5 Apr 2011 08:47:27 -0700") Message-ID: <86ipusd1wr.fsf@cmarib.ramside> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Subject: Re: [9fans] Making read(1) an rc(1) builtin? Topicbox-Message-UUID: cac89408-ead6-11e9-9d60-3106f5b1d025 Lyndon Nerenberg writes: >> Unfortunately, echon.c doesn't solve the problem either, because it >> doesn't output a trailing newline. > > That's the whole point. 'echon' replaces 'echo -n ...', then echo.c > loses all knowledge of any option flags. Oh. So there's another version of "echo", too? I didn't know that. /me pulls up lyndon's contrib again... Hm. I don't see an "echo.c" in there. But anyway, yes, splitting "echo" and "echo -n" into two commands would solve the problem in a symmetric way. ron minnich writes: > This discussion is interesting. > > "rc is not as good a shell as bash because it lacks built-ins that > make it a good programming language for writing an acme extension" > > Did I summarizer it correctly? Once summarized, am I the only one who > finds it absurd? No, I think a statement of the problem would be more like "rc(1) is not as useful a language as $fill_in_your_favorite_turing_complete_luggage because it's not Turing complete". You cannot map arbitrary input to arbitrary output with a program of finite size in pure rc(1). Developing an Acme client is just, historically, how I came to that discovery (and to my subsequent frustration with rc's feature set). I think string parsing and numeric comparisons are reasonable features to include in almost any programming language. I think having primitives for line-oriented input and line-oriented output are more than appropriate for a line-oriented language like rc(1). As it stands, rc(1) can have it's cake, but it can't eat it without a fork(2). -- +---------------------------------------------------------------+ |E-Mail: smiley@zenzebra.mv.com PGP key ID: BC549F8B| |Fingerprint: 9329 DB4A 30F5 6EDA D2BA 3489 DAB7 555A BC54 9F8B| +---------------------------------------------------------------+