11 votes

The original "Common Lisp the Language, Second Edition" in high quality typesetting

Tags: lisp, latex

8 comments

  1. [8]
    Drek
    Link
    I just downloaded the PDF and plan on reading it soon! I use AUTOLisp for work on occasion and I enjoy the syntax.

    I just downloaded the PDF and plan on reading it soon! I use AUTOLisp for work on occasion and I enjoy the syntax.

    1. [3]
      Moonchild
      Link Parent
      Why cltl2 rather than the ansi standard?

      Why cltl2 rather than the ansi standard?

      1 vote
      1. [2]
        Drek
        Link Parent
        Because I taught myself and I don't even understand the question you're asking! :)

        Because I taught myself and I don't even understand the question you're asking! :)

        1. Moonchild
          Link Parent
          See here. There were two editions published of the book 'Common Lisp the Language' (or 'CLtL', for short); the first in 1984, and the second in 1990. (A rendition of the latter is what is linked.)...

          See here.

          There were two editions published of the book 'Common Lisp the Language' (or 'CLtL', for short); the first in 1984, and the second in 1990. (A rendition of the latter is what is linked.) In 1994, an ANSI standard for Common Lisp derived from the book was published; this standard describes the language we know today as Common Lisp. CLtL has historical significance, but the language it describes (or, rather, the languages they describe, since there are two) is slightly different from that specified by the ANSI standard, and it has no users or implementations.

          1 vote
    2. [4]
      yonkeltron
      Link Parent
      Would love to hear and learn more about your experiences. Lisp is my mother tongue and, in many ways, the yardstick against which others are measured.

      Would love to hear and learn more about your experiences. Lisp is my mother tongue and, in many ways, the yardstick against which others are measured.

      1. [3]
        Drek
        Link Parent
        I have a background in Web Design and Python and took up AUTOlisp when I got a job using CAD as a Civil Drafter. I haven't really done anything special yet. I have a simple function that draws...

        I have a background in Web Design and Python and took up AUTOlisp when I got a job using CAD as a Civil Drafter. I haven't really done anything special yet. I have a simple function that draws pipes in model space with the user giving it a size, start, and end point. I also wrote a function that takes 2 or more multi leaders, determines the distance between thier point locations, and determine the slope using the text inside as elevation data. I use it to help check multiple spots on ADA ramps and parking grades!

        Here's the function for the last one:

        (defun c:sf( / input)
          
         ;	Set-up Error Handling  
        	(setq old_error_msg *error*)
        	(setq *error* new_error_msg)
         	(setq old_color (getvar "cecolor"))
        	(setq old_echo (getvar "cmdecho"))
        	(setq old_layer (getvar "clayer"))
        	(setq old_snap (getvar "osmode"))
          
        	(defun as( / rise run slope mleader1 mleader2 pre_point1 pre_point2 pt1 pt2 dline dister rele1 rele2 ele1 ele2)
        
        	;; Load Visual Lisp Functions
        		(vl-load-com)
        
        	;; Set active doc (Required for vlisp)
        		(setq *doc* (vla-get-activedocument (vlax-get-acad-object)))
        		
        	;; Prompt user to select distance line.
        		(setq tflag t)
        		(while (= t tflag)
        			(setq user_input (vl-catch-all-apply 'car (list (entsel "\n Select a Polyline for Distance:"))))
        			(if (/= user_input nil)
        				(if (= "LWPOLYLINE" (cdr (nth 0 (cdr (entget user_input)))))
        					(progn 
        						(setq dline user_input)
             					(setq tflag nil)
        					)
              				;else re-select
             				(princ "\n Bad Selection.... \n Select a Polyline for Distance:")
        				)
        				(princ "\n BAD SELECTION... TRY AGAIN...")
                    )
        		)
        	;; Set the lenght of the user selected distance line to <run>
        		(setq run (getpropertyvalue dline "length")) 
        	
        	;; Prompt user for the first mleader and save it as <mleader1>
        		(setq tflag t)
        		(while (= t tflag)
        			(setq user_input (vl-catch-all-apply 'car (list (entsel "\n Select First Multileader:"))))
        			(if (/= user_input nil)
        				(if (= "MULTILEADER" (cdr (nth 0 (cdr (entget user_input)))))
        				(progn 
              				(setq mleader1 (vlax-ename->vla-object user_input))
        					(setq tflag nil)
        				)
        				;else re-select
             			(princ "\n Bad Selection.... \n Select First Multileader:")
        				)
        		    	(princ "\n BAD SELECTION... TRY AGAIN...")
        			)
        		)
        	;; Extract text string from <mleader1>
        		(setq ele1 (vlax-get-property mleader1 'TextString))
        
        	;; Prompt user for the second mleader and save it as <mleader2>
        		(setq tflag t)
        		(while (= t tflag)
        			(setq user_input (vl-catch-all-apply 'car (list (entsel "\n Select Second Multileader:"))))
        			(if (/= user_input nil)
        				(if (= "MULTILEADER" (cdr (nth 0 (cdr (entget user_input)))))
        				(progn 
              				(setq mleader2 (vlax-ename->vla-object user_input))
        					(setq tflag nil)
        				)
        				;else re-select
             			(princ "\n Bad Selection.... \n Select Second Multileader:")
        				)
        		    	(princ "\n BAD SELECTION... TRY AGAIN...")
        			)
        		)
        
        	;; Extract text string from <mleader2>
        		(setq ele2 (vlax-get-property mleader2 'TextString))
        
        	;; Parse the mleader text strings to real numbers
        		(setq rele1 (atof ele1))
        		(setq rele2 (atof ele2))
        
        	;;Get Points from Mleaders
        		(setq pre_point1 (vlax-invoke mleader1 'getleaderlinevertices 0))
        		(setq pt1 (strcat (rtos (nth 0 pre_point1)) "," (rtos (nth 1 pre_point1)) ",0"))
        		(setq pre_point2 (vlax-invoke mleader2 'getleaderlinevertices 0))
        		(setq pt2 (strcat (rtos (nth 0 pre_point2)) "," (rtos (nth 1 pre_point2)))) 
        
        	;; Set the rise variable to the absolute value of (<mleader1> - <mleader2>)
        		(setq rise (abs (- rele1 rele2)))
        
        	;; Echo the Rise
        		(princ (strcat "\n RISE: " (rtos rise) "' \n"))
        
        	;; Calculate the slope	
        		(setq slope (rtos (* 100 (/ rise run)) 2 2))
        
        	;; Draw a dimaligned and replace the text with the slope
        		(command "dimaligned" pt1 pt2 "t" (strcat "RISE: " (rtos rise 2 2) "' \n" "RUN: " (rtos run 2 4) "' \n SLOPE: " slope "%") pause)
        
        	; Echo Rise, Run, & Slope
        		(princ "\n |==============================|")
        		(princ "\n |=== RISE === RUN === SLOPE ===|")
        		(princ "\n |==============================|")
        		(princ (strcat "\n" "RISE: " (rtos rise 2 2) "' \n"))	
        		(princ (strcat "RUN: " (rtos run 2 4) "' \n"))
        		(princ (strcat "SLOPE: " slope "% \n"))
        		(princ)
        	)
        
        

        I posted this on my phone if anything looks off

        1. [2]
          yonkeltron
          Link Parent
          This is SO amazing! Thanks a ton for sharing. I am deeply impressed.

          This is SO amazing! Thanks a ton for sharing. I am deeply impressed.

          1 vote
          1. Drek
            Link Parent
            Thank you! I just had a curiosity and figured it would be a good tool to have in the belt. I'd love to write efficiency/productivity scripts as a tech consultant one day.

            Thank you! I just had a curiosity and figured it would be a good tool to have in the belt. I'd love to write efficiency/productivity scripts as a tech consultant one day.