Sujet : Re: Command Languages Versus Programming Languages
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.unix.shell comp.unix.programmer comp.lang.miscDate : 30. Mar 2024, 00:14:42
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <uu7i13$im9b$1@dont-email.me>
References : 1 2 3
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 29.03.2024 21:59, Lawrence D'Oliveiro wrote:
On Fri, 29 Mar 2024 10:37:22 +0100, Janis Papanagnou wrote:
Program text is initially text.[*] During parsing (either in
an interpreted or in a compiled language) you split the text
in tokens.
And then, how do you interpret the tokens?
In an interpreter the tokens are interpreted, in a compiler
they are subject to the parsing. (But you know that I'm sure.)
What I was saying is that there's initially literal program text
that is transformed to tokens in the lexical analysis, and then
further processed.
It was a reply on your original statement which was:
In a shell language, everything you type is assumed to be a
literal string, unless you use special substitution sequences.
In a shell language, you have
the assumption that “everything is literal text until indicated
otherwise”;
Who is that "you"? (Not me, for sure.) And where did you get that
from?
in a programming language, you have the assumption that
“everything is a program construct until indicated otherwise”.
So what is 'for i in a ; do ... ; done' then in your world?
This is one of many basic shell constructs that I use in shell
programming (not "shell scripting") regularly.
Janis