Thread View: es.comp.os.linux.programacion
2 messages
2 total messages
Started by Oscar Manuel
Sun, 11 Jul 1999 00:00
Duda básica sobre Tcl
Author: 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) |
|--------------------------------------------|
Re: Duda básica sobre Tcl
Author: Sinner from the Prairy
Date: Mon, 12 Jul 1999 00:00
Date: Mon, 12 Jul 1999 00:00
25 lines
1298 bytes
1298 bytes
Oscar Manuel wrote:
> Entonces, �es cierto lo que dice el tutorial? �Estoy yo interpretando
> mal lo que dice?
Igual en las �ltimas versiones (+8.0) ya han corregido el tema. Y puede
que el manual sea de la 7.x
Piensa que en la versi�n 8.0 cambiaron un mont�n de cosas y, por
ejemplo, el wish lo aceleraron un mont�n. SEguro que lo hicieron
eliminando esa tonteria...
Nos leemos,
Sinner
--
...I've already seen STAR WARS I: The Phantom Menace...
[MaDuiXa PoWeR]
__________________
|\ Linux User # 89976
=====Sinner==== >=--[]>- a Mach 2.5!!
__________________|/ Linux Machine # 38068
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads