Re: Transcribe-file handles bad input badly
Kenny Tilton <[email protected]>
| Newsgroups | gmane.lisp.corman |
|---|---|
| Message-ID | <[email protected]> |
I am diving in anyway to see if I can make this work:
typedef struct {
float x, y;
} Vertex2d;
just guessing at the above syntax, the key is that transcribe-file
internals don't like the comma notation for defining a series of
variables with same type.
If I get anywhere I'll patch up the unsafe *package* binding as well.
kt
JP Massar wrote:
> A
>
>> > (defun transcribe-file (in-file out-file
>> > &optional (package :common-lisp-user)
>> > (prettyp t))
>>
>> > (when (string-equal in-file out-file)
>> > (error "Input and output file names are the same."))
>> > (let ((*package* (find-package package)))...
>>
>> So I guess *package* gets bound to nil if there is (one would hope!) no
>> package named package. This seems to make transcribe-file go away and
>> not come back.
>
>
>
> Binding *package* to NIL could be considered a bad idea
>
> :-)
>
> For instance, this hangs
>
> (let ((*package* nil)) (intern "FOO"))
>
> and this hangs
>
> (let ((*package* nil)) (error "Bad package: ~A" nil))
>
> but interestingly, this does not:
>
> (let ((*package* nil)) (error "OOPS"))
>
> Since *PACKAGE* can only legitimately be bound to a package,
> with presumably undefined consequences resulting if not,
> code which binds it must insure that this is so.
>
> So to fix TRANSCRIBE-FILE
>
> (let* ((p (find-package package))
> (*package* (or (and (packagep p) p)) (error "Not a known
> package: ~A" package)))
> ...
>
>
>
--
kenny tilton
clinisys, inc
http://www.tilton-technology.com/
---------------------------------------------------------------
"Cells let us walk, talk, think, make love and realize
the bath water is cold." -- Lorraine Lee Cudmore
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Get 128 Bit SSL Encryption!
http://us.click.yahoo.com/LIgTpC/vN2EAA/xGHJAA/SyjtlB/TM
---------------------------------------------------------------------~->
To unsubscribe from this group, send an email to:
[email protected]
Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/