TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Mark on May 24, 2004, 07:55:12 AM

Title: C++ compare to Autolisp
Post by: Mark on May 24, 2004, 07:55:12 AM
I used to think autolisp was this simple little language but after studying C++ I don't think that is the case anymore. Autolisp, or lisp in general is (in some ways) just as complex as C++. Also the similarities are are amazing, take for example the association list in autolisp and the structure in C++. They can both hold different types of variables and be easily accessed.
Code: [Select]

(setq offset
      (list
        (cons "name" "offset")
        (cons "Length" 14.14)
        (cons x 10.00)
        (cons y 20.00)
        )
      )

(cdr (assoc "Length" offset))
14.14


Code: [Select]

struct line   // structure template
{
    char name[20];
    float length;
    double x;
    double y;
};

line offset =
 {
   "offset",
   14.14,
   10.00,
   20.00
 };

cout << offset.length;
14.14
Title: C++ compare to Autolisp
Post by: Keith™ on May 24, 2004, 09:10:52 AM
Well, I see you are beginning to understand C++ a little better....

Maybe we should start comparing ideas and tips on C++
Title: C++ compare to Autolisp
Post by: Mark on May 24, 2004, 09:21:05 AM
>Maybe we should start comparing ideas and tips on C++

I don't think I'm at that stage yet, but i will keep it in mind. thanks.
Title: C++ compare to Autolisp
Post by: Keith™ on May 24, 2004, 09:43:43 AM
Shoot ... maybe you could teach me something... I never RTFM ... I learned by going to HKU