malformed list error on startup - which lisp?

Discussion in 'AutoCAD' started by Simon Wegner, Oct 20, 2004.

  1. Simon Wegner

    Simon Wegner Guest

    I just did some tweaking on a bunch of my lisp routines -slow day yesterday- including a number in my startup suite. Now I notice that I'm getting the "error - malformed list on input" message at startup. Without testing each routine individually, is there a simple way to find out which LISP has the error?
    Thanks in advance,

    Simon
     
    Simon Wegner, Oct 20, 2004
    #1
  2. Simon Wegner

    David Kozina Guest

    I HATE it when that happens! :)

    Bad thing is that there may be more than just one thing wrong - and you've
    only gotten to the first one... :-@

    Good thing is that it is usually something simple like a missing " or ).

    Basically, you've got to have a feel for what your routine load sequence is.

    The combinations are nearly endless, but if you've done any file organizing,
    you may have a file dedicated to that purpose. Or...
    You may have an acad.lsp file that does that.
    You may have an acaddoc.lsp file that does that.
    You may have some other .lsp file that does that.
    You may have an .mnl file that does that.
    Your startup suite may also be an indicator.

    If you know what has been already been loaded - perhaps a princ statement at
    the end of one file may print to the command line: 'Big Bunch of Dimension
    Routines Loaded.'
    By noting your command line messages (if you have any), you may be able to
    fairly easily find the offending routine by deduction. (Because File X was
    'next in line' and IT didn't get loaded, see?)

    If you don't have such messages in your routines, consider putting them in
    there.

    You also may be able to deduce what didn't get loaded by custom functions
    (from different files) that work and functions that don't. The ones that
    don't belong to a file that didn't make it, so check that file.

    Time to play detective. :)

    hth,
    David Kozina
     
    David Kozina, Oct 20, 2004
    #2
  3. Simon Wegner

    Paul Turvill Guest

    "Malformed list" *usually* means one or more missing ")" characters. If you
    have too many ")" or too few "(" you'll normally get an "Extra right paren"
    error; and a missing double quote (") will result in one of several "string"
    or "dotted pair" errors.

    If your LISP routines are in separate files, try loading each one manually
    until the error occurs, then ...

    start by matching the "(" and ")" characters in the code you tweaked.
    ___

    yesterday- including a number in my startup suite. Now I notice that I'm
    getting the "error - malformed list on input" message at startup. Without
    testing each routine individually, is there a simple way to find out which
    LISP has the error?
     
    Paul Turvill, Oct 20, 2004
    #3
  4. Simon Wegner

    Don Butler Guest

    What I'll do sometimes is to place a sequence of load time prompts or alerts
    before each defun such as...

    (prompt "\n0")
    (defun ...

    (prompt "\n1")
    (defun ...

    This will then show you where in the lisp file the error is occuring.

    You can delete or comment out the prompts afterward.

    Visual Lisp has some good debugging features that you could use as well.

    Don
     
    Don Butler, Oct 20, 2004
    #4
  5. Simon Wegner

    Tom Smith Guest

    I don't use the startup suite to load lisps. I prefer using a series of
    autoload statements in a lisp that's part of the startup sequence, e.g.
    acaddoc.lsp or an mnl file. This way there's no delay on opening a drawing
    while lisps are loaded. This isn't a huge deal with today's fast computers,
    but I still think it's better practice to not load a file until it's
    actually needed, as per the autolaod mechanism.

    A side effect of this would be that the error message wouldn't appear until
    the bad lisp is called, so you would immediately know where the problem
    lies.
     
    Tom Smith, Oct 20, 2004
    #5
  6. Simon Wegner

    Simon Wegner Guest

    Yeah, that's what I ought to do but haven't. The whole lisp thing is fairly new for me and I'm constantly creating new or editing old routines. I've been keeping most of my routines as individual files so no one screw up -something pretty frequent given my inexperience- doesn't kill everything. My computer's fast enough that this doesn't slow it down noticeably. I suppose my first move should be to compile it all with markers embedded.

    I ended up finding the problem routine - a simple parens issue- by reloading until I got the error again as Paul suggested. I guessed lucky and got it on the second try.

    Thanks to everyone. Now, off to create more problems....

    Simon
     
    Simon Wegner, Oct 20, 2004
    #6
  7. Simon Wegner

    Tom Smith Guest

    Perhaps you aren't familiar with autoloading lisp files. It's an easy way to
    prevent this kind of problem. It will also make it far easier to copy your
    setup to another computer or share it within your office. I'd suggest
    looking up autoload in help.
     
    Tom Smith, Oct 21, 2004
    #7
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.