Am Sa., 2. Dez. 2023 um 23:16 Uhr schrieb John Cowan <[email protected]>:

>
>
> On Sat, Dec 2, 2023 at 12:02 PM Marc Nieper-Wißkirchen <
> [email protected]> wrote:
>
>
>
>> One may draw the conclusion that neither SRFI 245 nor SRFI 251 are ready
>> for standardization if there is such a fundamental disagreement in the
>> community.
>>
>
> That is indeed the conclusion that I draw.
>


> For that matter, there are other alternatives, such as Javascript
> hoisting.  I think it is no accident that use-before-definition is
> forbidden in almost all languages nowadays, at least at a level other than
> the top level.  (Algol 68 and PL/I both feature it, but in the former case
> at least one major implementation banned it.)
>

What do you mean exactly by "use-before-definition"?

The following JS program seems valid:

function f ()
{
  let i;
  let g = (x) => h(x);
  i = 42;
  let h = (x) => x;
  return g (i);
}
f ();

Recursive functions work as in Scheme.

By the way, this program also shows that JS has R6RS/SRFI 245 semantics and
not SRFI 251 semantics.

Reply via email to