Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

error: bad argument type: streamp nil

0 views
Skip to first unread message

Randall D Foster

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
My Acad seems to be unraveling. Yesterday I posted a problem with "Remove"
function : it would run ok as a subr in A2K but returned null function in
R14. This morning when I boot up A2K, my autoloaded Lisp functions are
rejected at Startup with a MSG. error: bad argument type: streamp nil. I
get the same "streamp" MSG. with some menu bar loaded Lisp functions. Didn't
find info. on streamp in Acad or Vlisp help? Help!
Randy

Michel Trottier

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to Randall D Foster
Would be great to see those codes....we could be able to help

Michel

Alex Januszkiewicz

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
I'm not using Visual Lisp, but if streamp is what I think it is (stream
pointer), then check for operations of reading, writing from the file.
For example, if file ABC.TXT was not existing, situation like this could
cause the error:

(setq fp (open "c:\\abc.txt", "r"))
(setq txt (read-line fp))

The proper coding to avoid this would be:

(setq fp (open "c:\\abc.txt", "r"))
(if fp
(setq txt (read-line fp))
;else
(prompt "\nCannot open file for reading.")
)


--
Alex Januszkiewicz -> al...@intelcad.com
President, Intelcad Systems -> http://www.intelcad.com
911 DWG Recovery Services
ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development

--

Randall D Foster <rdf...@fgi.net> wrote in message
news:7mkob7$gc...@adesknews2.autodesk.com...

Tony Tanzillo

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
No - "streamp" does not mean "stream pointer", it's
a predicate function that returns T if its parameter
is a stream, or nil otherwise (predicate functions
end with "p").

--
/*********************************************************/
/* Tony Tanzillo Design Automation Consulting */
/* Programming & Customization for AutoCAD & Compatibles */
/* ----------------------------------------------------- */
/* tony.t...@worldnet.att.net */
/* http://ourworld.compuserve.com/homepages/tonyt */
/*********************************************************/

Tony Tanzillo

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
Well - You've obviously made some changes that have
introduced a bug in your code.

The "streamp" message is generally one that you'll see
if you call a function that requires an open file as one
of its paramters, but is getting something else.

Your code is bugged, but we can't tell you where the
problem is without seeing the code. You'll need to
step through the code and find out where the error
is, to find out what's wrong.

Tony Tanzillo

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
The (remove) function you show works in all releases of
AutoCAD.

If it is causing a 'null function' error in R14, then
it is not being loaded.


Randall D Foster wrote:
>
> Michel
>
> Below is the "Remove" function, as I noted in the previous post, It worked
> in A2K but not in R14, at least on my machine. So the 1st issue is why?
>
> ;;;REMOVE -Removes an item from a list (double elements allowed)
> (defun remove (expr lst) ;(c) by Serge Volkov
> (apply 'append (subst nil (list expr) (mapcar 'list lst)))
> );_end of defun ;
>
> And now my real problem is "error: bad argument type: streamp nil" ; I can
> only guess at what this MSG represents. The program code for the application
> was in the "final" stages of editing, and a real mess. I had a point sorting
> routine running well and was hooking up both the user input routines and the
> program output routines, when this morning Acad won't even refresh the
> edited version of the Lisp program, load fails with above MSG. and reverts
> to previous program.
> I got the same MSG when Acad loaded the CHText in starting with a blank
> DWG. in A2K this morning.
>
> These issues are probably not be related. But the fact that CHText failed
> with a blank dwg seems to point to a system setting. I have installed A2k
> over the top of R14 directory. Then, because of Calcomp Techjet 5524
> plotting problems, I re-installed R14 on the D: drive. This didn't seem to
> cause any problems for on my WinNT SP4 system Micron Pro2 200 Dual.
> I could post full listing if you think it would help.
> Regards,
> Randy
>
> Michel Trottier wrote in message <378DE53C...@isi-mtl.com>...


> >Would be great to see those codes....we could be able to help
> >
> >Michel
> >

Randall D Foster

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
Alex,
That was it.
Thanks. I am still puzzled over why introduction of the remove subr. would
cause a failure in program run in R14 but not in A2K.
Randy
Alex Januszkiewicz wrote in message <7mkqom$gc...@adesknews2.autodesk.com>...

>I'm not using Visual Lisp, but if streamp is what I think it is (stream
>pointer), then check for operations of reading, writing from the file.
>For example, if file ABC.TXT was not existing, situation like this could
>cause the error:
>
>(setq fp (open "c:\\abc.txt", "r"))
>(setq txt (read-line fp))
>
>The proper coding to avoid this would be:
>
>(setq fp (open "c:\\abc.txt", "r"))
>(if fp
> (setq txt (read-line fp))
>;else
> (prompt "\nCannot open file for reading.")
>)
>
>
>--
>Alex Januszkiewicz -> al...@intelcad.com
>President, Intelcad Systems -> http://www.intelcad.com
>911 DWG Recovery Services
>ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development
>
>--
snip...

Randall D Foster

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to

Randall D Foster

unread,
Jul 15, 1999, 3:00:00 AM7/15/99
to
Hi Tony,
... Concerning the remove function ...
It is a subroutine in a sort program that does run well in A2K ... I located
the streamp problem and fixed it.
The same program ran in R14 crashes with ...

... (1.54006 2.16506 2.79006 3.41506 4.04006) error: null function
(REMOVE YMAX YROWS)
(SETQ YROWS (REMOVE YMAX YROWS))
(REPEAT NROWS (SETQ YMAX (APPLY (QUOTE MAX) YROWS)) ...

I know the problem is not in the routine itself ...
I will plat with it a bit and see if I find a difference in level of
calling and parameters. I agree it should work in both versions.
Regards
Randy


Tony Tanzillo wrote in message <378E0D9B...@worldnet.att.net>...


>The (remove) function you show works in all releases of
>AutoCAD.
>
>If it is causing a 'null function' error in R14, then
>it is not being loaded.
>

snip...
> CHText failed< snip

The error MSG was being pumped in on the same line as the CHText load ...
it actually wasn't failing ... the auto-load of the menu bar fuction for the
sort routine was failing


>> with a blank dwg seems to point to a system setting. I have installed A2k
>> over the top of R14 directory. Then, because of Calcomp Techjet 5524
>> plotting problems, I re-installed R14 on the D: drive. This didn't seem
to
>> cause any problems for on my WinNT SP4 system Micron Pro2 200 Dual.
>> I could post full listing if you think it would help.
>> Regards,
>> Randy
>>
>> Michel Trottier wrote in message <378DE53C...@isi-mtl.com>...
>> >Would be great to see those codes....we could be able to help
>> >
>> >Michel
>> >
>> >Randall D Foster wrote:
>> >
>> >> My Acad seems to be unraveling. Yesterday I posted a problem with
>> "Remove"
>> >> function : it would run ok as a subr in A2K but returned null function
in
>> >> R14. This morning when I boot up A2K, my autoloaded Lisp functions are
>> >> rejected at Startup with a MSG. error: bad argument type: streamp
nil. I
>> >> get the same "streamp" MSG. with some menu bar loaded Lisp functions.
>> Didn't
>> >> find info. on streamp in Acad or Vlisp help? Help!
>> >> Randy
>> >
>

Alex Januszkiewicz

unread,
Jul 16, 1999, 3:00:00 AM7/16/99
to
I couldn't care less for the exact meaning of streamp especially that, as I
said before, I'm not using Visual Lisp. These days I'm 80% ObjectARX and 20%
old, good and predictable lisp.
Regardless of exact meaning, my point was, that Randall was trying to read
file using the stream pointer that was not successfully initialized by
open(). I gave him a piece of code that properly traps failure of open()
function and , if you read his last post, it appears that untrapped failure
of open() was his problem.

A stream is a stream.
A horse is a horse.
A streamp is, well .... a stream predicate function.

--
Alex Januszkiewicz -> al...@intelcad.com
President, Intelcad Systems -> http://www.intelcad.com
911 DWG Recovery Services
ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development

--

Tony Tanzillo <tony.t...@worldnet.att.net> wrote in message
news:378E05BF...@worldnet.att.net...


> No - "streamp" does not mean "stream pointer", it's
> a predicate function that returns T if its parameter
> is a stream, or nil otherwise (predicate functions
> end with "p").
>
> Alex Januszkiewicz wrote:
> >

> > I'm not using Visual Lisp, but if streamp is what I think it is (stream
> > pointer), then check for operations of reading, writing from the file.
> > For example, if file ABC.TXT was not existing, situation like this could
> > cause the error:
> >
> > (setq fp (open "c:\\abc.txt", "r"))
> > (setq txt (read-line fp))
> >
> > The proper coding to avoid this would be:
> >
> > (setq fp (open "c:\\abc.txt", "r"))
> > (if fp
> > (setq txt (read-line fp))
> > ;else
> > (prompt "\nCannot open file for reading.")
> > )
> >
> > --
> > Alex Januszkiewicz -> al...@intelcad.com
> > President, Intelcad Systems -> http://www.intelcad.com
> > 911 DWG Recovery Services
> > ObjectARX, WHIPTK (DWF), OpenDWG and MDL Development
> >
> > --
> >

> > Randall D Foster <rdf...@fgi.net> wrote in message
> > news:7mkob7$gc...@adesknews2.autodesk.com...

Tony Tanzillo

unread,
Jul 16, 1999, 3:00:00 AM7/16/99
to
Alex Januszkiewicz wrote:
>
> I couldn't care less for the exact meaning of streamp
> especially that, as I said before, I'm not using Visual Lisp.

I couldn't care less whether you do or do not care about
what the exact meaning of "streamp" is, I'm am simply
pointing out that your presumption that 'streamp' means
'stream pointer' is not correct.

Tony Tanzillo

unread,
Jul 16, 1999, 3:00:00 AM7/16/99
to
Alex Januszkiewicz wrote:
>
> I couldn't care less for the exact meaning of streamp
> especially that, as I said before, I'm not using Visual Lisp.

I don't care what you're using. I was simply stating that
'streamp' does not mean what you thought it did, and since
I would not bother to respond to your comment if it were
for your benefit only, consider my response to be for
the benefit of others looking in, who may be mislead by
your inaccurate presumption, regardless of whether you
care about/like it, or not.

Reinaldo Togores

unread,
Jul 18, 1999, 3:00:00 AM7/18/99
to
By the way... Don't you think Autodesk could document all these debugger
error messages so people don't have to be guessing what all these predicates
(streamp nil, stringp nil, consp nil, etc. etc.) mean?


--
Reinaldo Togores Fernández
Profesor Asociado
Dpto. Ing. Geográfica
y Técnicas de Expresión Gráfica
Universidad de Cantabria
http://start.at.autolisp/

Tony Tanzillo

unread,
Jul 18, 1999, 3:00:00 AM7/18/99
to
I blasted them for this in the initial release of
Visual LISP, but unfortunately, the seem to be quite
content with letting customers stuggle.

--

Reini Urban

unread,
Jul 21, 1999, 3:00:00 AM7/21/99
to
"Reinaldo Togores" <togo...@ccaix3.unican.es> wrote:
>By the way... Don't you think Autodesk could document all these debugger
>error messages so people don't have to be guessing what all these predicates
>(streamp nil, stringp nil, consp nil, etc. etc.) mean?

have a look into any lisp specs if it's not self-explanatory.
CLHS (the common lisp hyperspec) and CLtL2 (common lisp the language) is
even on-line. urls are at my lisp page.

all these error messages are failing type predicates, mostly generated
automatically.
a cons is a not-empty list,
a stream is a file or file-buffer (we have no pipes in vlisp),
a string is a string

of course they should be documented somehow.
--
Reini

0 new messages