On Mon, 16 Jan 2023, Sven Schreiber wrote:
Am 14.01.2023 um 10:35 schrieb Sven Schreiber:
> Am 13.01.2023 um 21:18 schrieb Cottrell, Allin:
>> On Thu, Jan 12, 2023 at 6:46 AM Sven Schreiber
>> <sven.schreiber(a)fu-berlin.de> wrote:
>>> sorry, here's again one of my crazy syntactic sugar ideas: I think it
>>> would be nice if hansl had a more concise way of writing a basic if-endif
>>> block, where the thing to be executed is just a single line.
>> I agree; this is something I've thought about from time to time. I
>> kinda like the fortran approach to the one-liner:
>>
>> if <condition> then <whatever>
>>
>> which would require "then" as a new keyword. We can discuss this when
>> we next get a chance.
>>
> Sure, having a new keyword wouldn't be so bad. And making the
> cross-connection with the different boolean message I just sent: maybe even
> introducing AND and OR (all caps, presumably) as aliases for && and ||
> could be nice for a high-level language, like we did with TRUE and FALSE.
> But let's discuss this.
>
One more thought on this: I guess that in a one-liner no commands would be
allowed, right? It seems a bit strange to have something like:
if <whatever> then ols y const x
Such a constraint wouldn't be so bad, but what about the whole "genr"
apparatus as a command? Something like:
if <whatever> then a = 3
looks nice, but the explicit variant already looks stranger:
if <whatever> then scalar a = 3
Hm.
FWIW, I wouldn't like the "one-line-if-statement" very much. (Of course,
you may say, I'd be free to avoid it, but...)
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------