Author Topic: C++ compare to Autolisp  (Read 2833 times)

0 Members and 1 Guest are viewing this topic.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
C++ compare to Autolisp
« 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
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
C++ compare to Autolisp
« Reply #1 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++
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
C++ compare to Autolisp
« Reply #2 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.
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
C++ compare to Autolisp
« Reply #3 on: May 24, 2004, 09:43:43 AM »
Shoot ... maybe you could teach me something... I never RTFM ... I learned by going to HKU
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie