In the autolisp programming language, i would like to know the origin of the list functions named car, cdr and cadr. Autolisp supports concatenations of car and cdr up to four levels deep. This is also new possible to do with the hatch edit command in newer versions of autocad. As far as lisp is concerned, the atoms of a list are unsplittable. Auto dimesioning polyline modified pdim lisp autolisp. An advise, just upload the lisp file with the two picture because most of users do not like downloading files from unknown website that may hold any threats. The car of a list is, quite simply, the first item in the list. The car and cdr functions are used for splitting lists and are considered fundamental to lisp. Im just curious about where these terms originated. Afralisp helps you learn how to use autolisp the autocad api. Both car and cdr are also setf able placesgiven an existing cons cell, its possible to assign a new value to either of its values. The primary command for taking a list apart is the car function. In lisp, cadr 1 2 3 is the equivalent of car cdr 1 2 3. In scheme, car, cdr, and cons are the most important functions.
Autolisp provides the cadr function which is basically an abbreviation of a nested command. An autolisp tutorial demonstrating how to create a simple block counter program. Cdr, car, cadr, and more linkedin learning, formerly. Do you want to restore hatch boundaries in autocad. Lists, car and cdr we are going to direct our attention towards the structure of data in the lisp language. In autolisp, car is frequently used to obtain the x coordinate of a 2d or 3d point the first element of a list of two or three reals. In autolisp, cadr is frequently used to obtain the y coordinate of a 2d or 3d point the second element of a list of two or three reals.
1635 1217 363 1596 24 1604 240 1351 15 656 858 1552 756 311 1373 353 1550 479 494 662 886 930 475 3 293 1396 1266 325 1307 1072 923