Re: Array get element with default (no error if not exist)

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Array get element with default (no error if not exist)
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tcl
Date : 18. Aug 2024, 17:43:41
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v9t8bt$2euft$1@dont-email.me>
References : 1 2 3 4 5
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
RodionGork <rodiongork@github.com> wrote:
Thank you, this definitely makes sense!
 
I remember about issue with passing/returning array in functions. By the
way I still am not sure why it works with global for example... if they
are actually different variables, every key-pair :) e.g. like here:
 
https://github.com/RodionGork/languages-benchmark/blob/main/02-primes/primes_a.tcl#L7

Because the [global] command works with names of variables, not the
actual variables.  It links the global variable with the given name, to
a local variable of the same name, inside the proc.  If the global name
references an array, then the new local name inside the proc references
the same array.


Date Sujet#  Auteur
16 Aug 24 * Array get element with default (no error if not exist)8RodionGork
16 Aug 24 +* Re: Array get element with default (no error if not exist)5Ralf Fassel
17 Aug 24 i`* Re: Array get element with default (no error if not exist)4RodionGork
17 Aug 24 i `* Re: Array get element with default (no error if not exist)3Rich
18 Aug 24 i  `* Re: Array get element with default (no error if not exist)2RodionGork
18 Aug 24 i   `- Re: Array get element with default (no error if not exist)1Rich
16 Aug 24 `* Re: Array get element with default (no error if not exist)2Emiliano
16 Aug 24  `- Re: Array get element with default (no error if not exist)1Ralf Fassel

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal