+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
  1. #1
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default failed to understand the error..

    Registered forum members do not see this ad.

    Hi.. as I told before, I am a beginner in LISP, trying to write something, but getting error.. "error: malformed list on input" . what it means?

    I have list :- ((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))

    I want this as :- (((x y) (z a)) ((m n) (o p)))


    (defun test1 ()
    (setq gb '((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))

    (setq blanka '())

    (setq blankb '())

    (setq len1 (length gb))

    (setq count1 0)

    (while (< count1 len1)

    (setq data1 (nth count1 gb))

    (setq len2 (length data1)

    (setq count2 0)

    (while (<count2 len2)

    (setq data2 (nth count2 data1))

    (setq blankb (append blankb (list data2)))

    (setq count2 (1+ count2))

    ) ; while

    (setq blanka (append blanka (list data1)))

    (setq count1 (1+ count2))

    ) ;while

    )




  2. #2
    Super Member resullins's Avatar
    Computer Details
    resullins's Computer Details
    Operating System:
    XP... moving to 7 soon, hopefully.
    Computer:
    Dell Precision T4500
    CPU:
    Intel Xeon E5405
    RAM:
    4.00 GB
    Graphics:
    NVidia Quadro NVS 290
    Monitor:
    Dual Dell 20" 16x9 running DVI-D
    Using
    AutoCAD 2014
    Join Date
    Feb 2011
    Location
    Nashville, TN
    Posts
    541

    Default

    It means your parenthesis don't match. You have to have the same number of open parenthesis as closed. That's why LISP stands for "Lost in Stupid Parenthesis."

    Also, you're new, so you get a pass, but you need to wrap any and all code your post here in the code tags (the button that looks like a pound sign).

    Code:
    Then your code will look like this.

  3. #3
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default

    sorry..I don't know the tagging process.. how I use code tag?

  4. #4
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,789

    Default

    Maybe this troubleshooter will help you in the future.

    Also, as resullins states, enclose your code in code tags:

    [code]Your code here[/code]
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  5. #5
    Super Moderator SLW210's Avatar
    Computer Details
    SLW210's Computer Details
    Operating System:
    Windows 7 PRO
    Computer:
    IBM Lenovo
    Motherboard:
    ACPI x86
    CPU:
    Pentium(R) Dual-Core CPU E5500 @ 2.80GHz
    RAM:
    4 GB RAM
    Graphics:
    Nvidia Quadro 600 1GB
    Primary Storage:
    300 GB
    Secondary Storage:
    650GB
    Monitor:
    ThinkVision 24"
    Discipline
    Multi-disciplinary
    SLW210's Discipline Details
    Occupation
    Design Draftsman
    Discipline
    Multi-disciplinary
    Details
    Mostly do drafting related to manufacturing. From doing site layouts with proposed updates, additions and renovations to be budgeted and submitted for bid, to updating and changing existing drawings to reflect maintenance and repair/revision work done on site.
    Using
    AutoCAD 2011
    Join Date
    May 2007
    Location
    South Florida, USA
    Posts
    10,023

    Default

    Quote Originally Posted by nila_joy View Post
    sorry..I don't know the tagging process.. how I use code tag?
    CODE POSTING GUIDELINES
    “A narrow mind and a fat head invariably come on the same person” Zig Zigler



  6. #6
    Super Member resullins's Avatar
    Computer Details
    resullins's Computer Details
    Operating System:
    XP... moving to 7 soon, hopefully.
    Computer:
    Dell Precision T4500
    CPU:
    Intel Xeon E5405
    RAM:
    4.00 GB
    Graphics:
    NVidia Quadro NVS 290
    Monitor:
    Dual Dell 20" 16x9 running DVI-D
    Using
    AutoCAD 2014
    Join Date
    Feb 2011
    Location
    Nashville, TN
    Posts
    541

    Default

    @nila_joy: Don't pay attention to SLW210... he really hates people that miss his rules!

    Now, you know for next time!

  7. #7
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default

    Hi.. as I told before, I am a beginner in LISP, trying to write something, but getting error.. "error: malformed list on input" . what it means?

    I have list :- ((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))

    I want this as :- (((x y) (z a)) ((m n) (o p)))


    Code:
    (defun test1 ()
      (setq gb '((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))
    
    (setq blanka '())
    
    (setq blankb '())
    
    (setq len1 (length gb))
    
    (setq count1 0)
    
    (while (< count1 len1)
    
    (setq data1 (nth count1 gb))
    
    (setq len2 (length data1)
    
    (setq count2 0)
    
    (while (<count2 len2)
    
    (setq data2 (nth count2 data1))
    
    (setq blankb (append blankb (list data2)))
    
    (setq count2 (1+ count2))
    
    ) ; while
    
    (setq blanka (append blanka (list data1)))
    
    (setq count1 (1+ count2))
    
    ) ;while
    
      )

  8. #8
    Full Member nila_joy's Avatar
    Computer Details
    nila_joy's Computer Details
    Operating System:
    Windows
    Discipline
    Mechanical
    nila_joy's Discipline Details
    Occupation
    Design Engineer
    Discipline
    Mechanical
    Details
    working on various tools like cad, Pro-E, Lisp , VB. Working on automation department.
    Using
    AutoCAD 2011
    Join Date
    Nov 2011
    Location
    Kolkata, India
    Posts
    26

    Default

    got it man.. actually I was playing Company of heroes,but hanged when got ur msg .. ur words made it man

  9. #9
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    16,789

    Default

    Consider this function:

    Code:
    (setq l '((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))
    
    (mapcar
        (function
            (lambda ( a )
                (mapcar
                    (function
                        (lambda ( b ) (mapcar 'cdr b))
                    )
                    a
                )
            )
        )
        l
    )
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  10. #10
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2013
    Join Date
    Apr 2008
    Posts
    6,143

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Lee Mac View Post
    Consider this function:

    Code:
    (setq l '((((1 . x ) (2 . y)) ((3 . z) (4 . a))) (((1 . m ) (2 . n)) ((3 . o) (4 . p)))))
    
    (mapcar
        (function
            (lambda ( a )
                (mapcar
                    (function
                        (lambda ( b ) (mapcar 'cdr b))
                    )
                    a
                )
            )
        )
        l
    )
    HaHa, I was just about to post this:

    Code:
    (defun foo (lst)
      (mapcar '(lambda (a) (mapcar '(lambda (b) (mapcar 'cdr b)) a)) lst)
    )
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

Similar Threads

  1. Fatal Error - tried re-installing autocad 2012, but failed to reinstall everything
    By soxgreen in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 7
    Last Post: 24th Oct 2011, 02:21 pm
  2. Replies: 0
    Last Post: 22nd Apr 2011, 09:40 pm
  3. Error: ARXLOAD failed... help please
    By Rsblades in forum AutoCAD Bugs, Error Messages & Quirks
    Replies: 4
    Last Post: 19th Jun 2009, 04:52 pm
  4. R14: Instal'n failed with error code 9
    By Stinsoneer in forum AutoCAD Beginners' Area
    Replies: 21
    Last Post: 13th Sep 2008, 11:55 am
  5. General Error - Failed Sending Email
    By CADTutor in forum News, Announcements & FAQ
    Replies: 3
    Last Post: 29th Jan 2003, 11:02 pm

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts