Jump to content

Building Association Lists: A Simple Block Counter [AutoLISP Tutorial]


Lee Mac

Recommended Posts

I've spent some time writing up the following tutorial which aims to demonstrate how to construct a simple block counter and in the process give the user an introduction to association lists and dotted pairs:

Building Association Lists: A Simple Block Counter

 

The tutorial is a step-by-step walkthrough of the process of creating the block counter, with diversions here and there to explain the various concepts used by the program.

 

Throughout the tutorial I've also tried to explain why every part of the code is used in the way that it is, rather than providing the reader with a block of code and leaving some parts without an explanation (for example, why the program should include (princ) or (prin1) as the last expression etc.).

 

I welcome your feedback on the tutorial -

 

Is it too simplified?

Is it too long?

Too boring?

All of the above?

 

Feel free to also point out any typos, as these can be difficult to spot when proof-reading your own work.

 

Thanks,

 

Lee

Link to comment
Share on other sites

First off : VERY nice !

 

A suggestion

 

(setq sel ;; Assign the value returned by the following expression to the symbol 'sel'

 

Maybe the term bind or bound is more apropos to LISP language than assign

 

Maybe a small explanation or an example of a quoted symbol ( setq vs set )

 

(setq  sel "Valid")
(set  'sel  "Valid)
(set (quote sel) "Vaild")

 

Your format is different from any I've seen before. It will be interesting to hear the feedback from a true newbie.

 

Regard -David

Link to comment
Share on other sites

Oh man Xmas gift from Lee....

 

Merry Christmas!

 

Looks nice at first glance. Can't say that its too booring, long or simplified, otherwise you couldn't teach newbies like me.

Merry xmas, guys!

 

Thanks - I hope its comprehensible! :)

 

Nice Lee. Thanks for your tut. Can i translate it to my language and post somewhere with ur @ ?^^

 

You are welcome to translate the tutorial and post it elsewhere, but I would ask that you include a note stating that the post is a translation with a link to the original tutorial on my site - thanks.

 

wow really appreciate Lee sacrifices this Xmas moment in writing this long tut for lisp community

:thumbsup:

 

You're welcome, my pleasure.

 

First off : VERY nice !

 

Thank you David! :thumbsup:

 

A suggestion

(setq sel ;; Assign the value returned by the following expression to the symbol 'sel'

Maybe the term bind or bound is more apropos to LISP language than assign

 

Maybe a small explanation or an example of a quoted symbol ( setq vs set )

(setq  sel "Valid")
(set  'sel  "Valid)
(set (quote sel) "Vaild")

 

Coincidentally, I had considered a few different ways of wording this, using phrases such as 'bind' or that the variable 'points' to the data, but I eventually chose 'assign' as I didn't want the language used in the tutorial to be overly technical so as to bewilder a beginner from the outset.

 

Perhaps the process of how data is bound to a variable, or how the variable accesses the appropriate memory address is best covered in a separate tutorial.

 

Your format is different from any I've seen before. It will be interesting to hear the feedback from a true newbie.

 

Do you mean the process of building the program expression-by-expression, or the accompanying explanations?

 

Thanks for the feedback - I appreciate it!

Link to comment
Share on other sites

I think I leaned more toward (boundp).

 

As to the format, I guess I'd describe yours as the evolution of a program. Interesting concept.

 

Maybe removing the comments from the previous example would emphasize the added calls. Just a thought.

 

We all learn differently, so it will be interesting to to see other responses.

 

-David

Link to comment
Share on other sites

  • 6 months later...
Merry Christmas!

 

 

 

Thanks - I hope its comprehensible! :)

 

 

 

You are welcome to translate the tutorial and post it elsewhere, but I would ask that you include a note stating that the post is a translation with a link to the original tutorial on my site - thanks.

 

 

 

You're welcome, my pleasure.

 

 

 

Thank you David! :thumbsup:

 

 

 

Coincidentally, I had considered a few different ways of wording this, using phrases such as 'bind' or that the variable 'points' to the data, but I eventually chose 'assign' as I didn't want the language used in the tutorial to be overly technical so as to bewilder a beginner from the outset.

 

Perhaps the process of how data is bound to a variable, or how the variable accesses the appropriate memory address is best covered in a separate tutorial.

 

 

 

Do you mean the process of building the program expression-by-expression, or the accompanying explanations?

 

Thanks for the feedback - I appreciate it!

 

 

My native language is Spanish and I am little experimented in AutoLISP but anyway your tutorial was completely understandable for me. I was needing exactly an association list for a routine.

 

Thank you very much.

Link to comment
Share on other sites

Excellent to hear gammnuevo! - I'm delighted that you found the tutorial to be clear & comprehensible, even with English as a second language!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...