plusieurs question en 1
#8
man proc:
Citation :If the last formal argument has the name args, then a call to the procedure may contain more actual arguments than the procedure has formals. In this case, all of the actual arguments starting at the one that would be assigned to args are combined into a list (as if the list command had been used); this combined value is assigned to the local variable args.

args est le seule argument spécial utilisé en tcl
en gros il crée une liste des différent arguments qu'il contient
quand arg contient {a b c d}
args contiendra {{a b c d}} donc une double liste

edit:
Code :
% proc test arg {return $arg}
% test "a b c d"
a b c d
% proc test args {return $args}
% test "a b c d"
{a b c d}
C'est en reconnaissant ses erreurs que l'on progresse Wink
Répondre Avertir


Messages dans ce sujet
plusieurs question en 1 - par tedcampa - 21/03/2011, 11:54
RE: plusieurs question en 1 - par CrazyCat - 21/03/2011, 12:27
RE: plusieurs question en 1 - par MenzAgitat - 21/03/2011, 15:03
RE: plusieurs question en 1 - par tedcampa - 22/03/2011, 02:26
RE: plusieurs question en 1 - par djkenny - 22/03/2011, 08:20
RE: plusieurs question en 1 - par CrazyCat - 22/03/2011, 09:56
RE: plusieurs question en 1 - par tedcampa - 22/03/2011, 11:31
RE: plusieurs question en 1 - par djkenny - 22/03/2011, 11:45

Atteindre :


Utilisateur(s) parcourant ce sujet : 1 visiteur(s)
Tchat 100% gratuit -Discutez en toute liberté