Article View: es.comp.os.linux.programacion
Article #18807Duda básica sobre Tcl
From: Oscar Manuel
Date: Sun, 11 Jul 1999 00:00
Date: Sun, 11 Jul 1999 00:00
56 lines
2433 bytes
2433 bytes
Estoy empezando a pegarme con un tutorial de Tcl, y en la lección 11
pone:
"In Tcl there is no distinction between functions and commands. There
are no reserved words as exist in C, BASIC, FORTRAN, etc. When the Tcl
interpreter starts up there is a list of known functions in the table
that the interpreter uses to parse a line. These are the commands that
Tcl knows about by default. These commands include while, for, set,
puts, etc."
Que yo interpreto como que no existen palabras reservadas en Tcl, y por
tanto se pueden definir rutinas con el nombre de palabras reservadas, y
viene con un ejemplo ilustrativo sobre una "redefinición" de la orden
for:
proc for {a b c} {
puts "The for command has been replaced by a puts";
puts "The arguments were: $a\n$b\n$c\n"
}
for {set i 1} {$i < 10} {incr i}
Pero si lo ejecuto, obtengo este error:
---------- ERROR ----------
Error in startup script: wrong # args: should be "for start test next
command"
while compiling
"for {set i 1} {$i < 10} {incr i}"
Si renombro la subrutina y la llamada a cualquier nombre que no sea
"for", no obtengo errores, y el siguiente resultado:
The for command has been replaced by a puts
The arguments were: set i 1
$i < 10
incr i
Entonces, ¿es cierto lo que dice el tutorial? ¿Estoy yo interpretando
mal lo que dice?
--
http://counter.li.org registration info
---------------------------------------
Linux user: 92390 - Linux machine: 39301
|--------------------------------------------|
| Oscar Manuel Gómez Senovilla |
| mailto:oscar@BORRARomgs.findhere.com |
| mailto:oscar@BORRARsantandersupernet.com |
| (quita "BORRAR" después de @) |
| (remove "BORRAR" after @) |
| Madrid (España) |
|--------------------------------------------|
Technical Details
Message-ID:
<3789099E.5B780E6C@omgs.es>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: f86c8,4707d1e086714f20,start X-Google-Attributes: gidf86c8,public From: Oscar Manuel <oscar@omgs.es> Subject: Duda básica sobre Tcl Date: 1999/07/11 Message-ID: <3789099E.5B780E6C@omgs.es> X-Deja-AN: 499907456 Content-Transfer-Encoding: quoted-printable Organization: Estoy harto de spammers X-Accept-Language: es, en X-Server-Date: 11 Jul 1999 21:16:14 GMT Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 Newsgroups: es.comp.os.linux.programacion