Why is tcl broken?

Cameron Laird claird at Starbase.NeoSoft.COM
Tue Jun 29 11:58:03 EDT 1999


In article <lwso7bdnia.fsf at copernico.parades.rm.cnr.it>,
Marco Antoniotti  <marcoxa at copernico.parades.rm.cnr.it> wrote:
			.
			.
			.
>I have no problems with that.  But the following example is pretty
>hard to beat. :)
>
>==============================================================================
>* (defmacro zut (a) `(list ,a))
>ZUT
>
>* (defun zot (x) (zut x))
>ZOT
>
>* (compile 'zot)
>ZOT
>
>* (disassemble 'zot)
>071B5790:       .ENTRY ZOT(x)                ; (FUNCTION (T) LIST)
>     7A8:       ADD   -18, %CODE
>     7AC:       ADD   %CFP, 32, %CSP
>
>     7B0:       CMP   %NARGS, 4              ; %NARGS = #:G0
>     7B4:       BNE   L0
>     7B8:       NOP
>     7BC:       MOVE  %A0, %A4               ; %A0 = #:G1
>     7C0:       MOVE  %A4, %A0               ; No-arg-parsing entry point
>     7C4:       ADD   4, %ALLOC
>     7C8:       ANDN  %ALLOC, 7, %A3
>     7CC:       OR    3, %A3
>     7D0:       MOVE  %A3, %A1
>     7D4:       ST    %A0, [%A1-3]
>     7D8:       ST    %NULL, [%A1+1]
>     7DC:       TADDCCTV 4, %ALLOC
>     7E0:       MOVE  %A3, %A0
>     7E4:       MOVE  %CFP, %CSP
>     7E8:       MOVE  %OCFP, %CFP
>     7EC:       J     %LRA+5
>
>     7F0:       MOVE  %LRA, %CODE
>     7F4:       UNIMP 0
>     7F8: L0:   UNIMP 10                     ; Error trap
>     7FC:       BYTE  #x04
>     7FD:       BYTE  #x19                   ; INVALID-ARGUMENT-COUNT-ERROR
>     7FE:       BYTE  #xFE, #xED, #x01       ; NARGS
>     801:       .ALIGN 4
>* 
>==============================================================================
>
>Of course I could have defined a much more intricated macro.
			.
			.
			.
As it happens, there's very good work going on just now
to beef up Tcl's introspective capabilities.  Is *that*--
introspection--the real content of your preference?
Incidentally, many of the same ideas and possibilities
are available to Python, although I don't know of anyone
actively pursuing them for Python.  While Tim Peters im-
presses me with, among much else, his ability to code
clever little methods that tease all sorts of informa-
tion from a Python interpreter, I occasionally argue that
'twould be worth the effort to do introspection for Py-
thon in a more unified way.
-- 

Cameron Laird           http://starbase.neosoft.com/~claird/home.html
claird at NeoSoft.com      +1 281 996 8546 FAX




More information about the Python-list mailing list