Ruud H.G. van Tol on Sat, 15 Nov 2025 13:02:00 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: Comments between lines raise syntax error




On 2025-11-15 12:49, Ewan Delanoy wrote:
>I advise to use { ... } for complicated multi-line statements instead of a >line continuation \. The latter works best for a very small number of lines.

On the other hand, if one wishes to separate subinstructions line by line for readibility inside a "while" or "if" loop inside a function, line continuations are all that's available, right ? The error message is "***   sorry, embedded braces (in parser) is not yet implemented."



For example, in the code below I cannot forego the line continuations if I wish to avoid the not very readable one-liner "example()=if(noMeatToday(),cry();roar(););", right ?

Cheers,

E. D.

noMeatToday()=1
cry()={}
roar()={}

example()={
  if(noMeatToday(),\
     cry();\
     roar();\
  );
}


Just one of the many ways:

{ my
  ( noMeatToday()= 1
  , cry()= print("cry")
  , roar()= print("roar")
  );

  example()=
    if
    ( noMeatToday()
    , cry()
    , roar()
    );
}

? example()
cry

Notice that I made the initial 3 functions all lexical.

-- Ruud