Author Topic: list of error meanings...  (Read 3386 times)

0 Members and 1 Guest are viewing this topic.

andrew_nao

  • Guest
list of error meanings...
« on: July 03, 2013, 12:45:09 PM »
a while ago someone had posted a website with errors meanigns
consp
stingp
etc...

does anyone remember this website? or have a list of the errors and meanings?

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: list of error meanings...
« Reply #1 on: July 03, 2013, 01:49:53 PM »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

andrew_nao

  • Guest
Re: list of error meanings...
« Reply #2 on: July 03, 2013, 01:55:56 PM »
thank you once again

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: list of error meanings...
« Reply #3 on: July 03, 2013, 03:42:43 PM »
Thanks CAB; I'm glad you find the reference useful Andrew  :-)

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: list of error meanings...
« Reply #4 on: July 04, 2013, 04:50:53 AM »
Nice page Lee. One thing I'm not sure about: the difference between the consp and listp error. They seem to mean the exact same thing. Is there perhaps one scenario where consp is sent rather than listp, e.g. when a dotted pair is expected, not just a list?
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: list of error meanings...
« Reply #5 on: July 04, 2013, 06:40:33 AM »
Nice page Lee. One thing I'm not sure about: the difference between the consp and listp error. They seem to mean the exact same thing. Is there perhaps one scenario where consp is sent rather than listp, e.g. when a dotted pair is expected, not just a list?

Thanks Irné  :-)

Whilst writing the reference, I also attempted to ascertain the difference between the consp & listp argument type error messages, but as far as I can remember, I couldn't find any underlying reason why consp is returned rather than listp for some functions, for example:

Code: [Select]
_$ (nth 0 nil)
; error: bad argument type: consp nil
Surely this should be listp since nth requires a list argument, not a dotted pair?

Code: [Select]
_$ (append 'a)
; error: bad argument type: listp A
This seems logical since append cannot accept a dotted pair argument (bad list error).

Code: [Select]
_$ (assoc 'a 'a)
; error: bad argument type: listp A
Again logical since assoc will return a bad association list error if fed a dotted pair.

In summary:
Code: [Select]
Function          Error Data Type
=================================
append                 listp
assoc                  listp
c...r                  consp
foreach                consp
last                   listp
length                 listp
mapcar                 listp
member                 consp
nth                    consp
vl-every               listp
vl-list->string        listp
vl-list-length         listp
vl-member-if           listp
vl-member-if-not       listp
vl-position            listp
vl-remove              listp
vl-remove-if           listp
vl-remove-if-not       listp
vl-some                listp
vl-sort                listp
vl-sort-i              consp

foreach, member, nth & vl-sort-i just don't seem to fit the pattern.

andrew_nao

  • Guest
Re: list of error meanings...
« Reply #6 on: July 08, 2013, 09:51:32 AM »
Thanks CAB; I'm glad you find the reference useful Andrew  :-)

its essential for me when i code, most times it helps me located where my errors are and what i did wrong.  i used to have a text file of them saved but i cant find it on my harddrive.

thanks for your time putting these together


Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: list of error meanings...
« Reply #7 on: July 08, 2013, 10:05:53 AM »
its essential for me when i code, most times it helps me located where my errors are and what i did wrong.  i used to have a text file of them saved but i cant find it on my harddrive.

thanks for your time putting these together

You're very welcome Andrew  :-)

Regarding how to locate the source of an error, sometimes this can be trivial given the content of the error message, but for more elusive errors, I always resort to the method described in my tutorial here under the section 'Where did the Code Fail?'.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: list of error meanings...
« Reply #8 on: July 09, 2013, 01:48:09 AM »
I always resort to the method described in my tutorial here under the section 'Where did the Code Fail?'.
Too true! I sometimes even ignore the error message and rather just use VLIDE to show me where the error happened - tends to give "me" more info about the error that way.

An old method of trying to get more info was to use the trace function. At least you could then read the command-line to determine which defun was called last when the error happened.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: list of error meanings...
« Reply #9 on: July 09, 2013, 06:28:20 AM »
An old method of trying to get more info was to use the trace function.

I agree - I use trace a lot when debugging recursive functions as the Trace window in the VLIDE will contain a log of each function evaluation, the supplied arguments and the returns of each evaluation.

andrew_nao

  • Guest
Re: list of error meanings...
« Reply #10 on: July 09, 2013, 09:08:00 AM »
i do use that method sometimes, only when the routine isnt long.
most of my routines i work on involve some type of external file reading and writing, to and from and can sometimes take 20 mins to go thru the routine. so what i like to do is put most things in sub functions and call them. it makes it easy for me to see where i went wrong and what i did plus i get an education at the same time.


CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: list of error meanings...
« Reply #11 on: July 09, 2013, 09:26:19 AM »
i do use that method sometimes, only when the routine isnt long.
Andrew,
You need to set break points so that you may step through only those sections of code you wish to.
The length of the routine should have no bearing on the debug method.  :)

I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: list of error meanings...
« Reply #12 on: July 10, 2013, 01:27:44 AM »
The length of the routine should have no bearing on the debug method.  :)
Agreed. The trace function would only list the defun started, so if you only use trace - then you'd need to ensure your defuns are as simplistic / split as possible.

But VLIDE's other debug stuff is a lot more fine-grained and can show you each item inside the defun. Breakpoints are definitely the way to go. You can even use VLIDE's "Last Break Source" option (Ctrl+F9) as per Lee's tut to find out where inside the defun the error occurred - then set a breakpoint just before it and run your code again (open a watch window and inspect your variables' values to check if something has a value which it shouldn't).

I even use breakpoints + watch to figure out what's happening inside any defun. Sometimes its as simple as a variable name slightly misspelled or such.
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.