Showing posts with label visual lisp. Show all posts
Showing posts with label visual lisp. Show all posts

Wednesday, July 24, 2013

Big News! E-Book Price Reductions!

If you have ever stayed awake long enough to read through any of my books: THANK YOU!

If you've read one or two of them, and wondered if any of the others are any good, well.... now is your chance to explore.


Big News...
Major Pricing Discounts on my E-Books!


Major Discounts will be applied starting this week.  Amazon has to process the price changes, so they may not be posted for another 24-48 hours (from today: July 24, 2013).

If you still see the "Old Price" posted on the Amazon product page, refresh the web page or come back to it until you see the updated prices.

The new prices are shown below.  Read the Q & A below for more information...





Amazon Kindle Publication Old Price (USD) New Price (USD) Discount

Grinding Gears: The Art of Software Repackaging and Deployment

Packaging, Testing, Deploying, Uninstalling and Upgrading Software Applications on the Windows platform.  Also covers Configuration Manager, Scripting, Group Policy, and more!
$6.99 $5.99 15%

Why Your Next IT Project Will Fail (and What You Can Do to Avoid It)

Why do Projects fail? More specifically: Why do IT Projects fail? Is there a common thread or pattern that exists among failed IT Projects? Is it predominantly a failure of technology; of people; or a failure of both? Are there warning signs that make it easy to spot the causes before they become problems, with sufficient time to correct them? Are there steps that can be taken to correct the problem once it's begun? Are there strategies that can help prevent these potential issues from occurring again?
$4.99 $2.99 40%

The Visual LISP Developer's Bible: 2011 Edition

Developing, Testing and Compiling VLISP code for AutoCAD 2011.  VLIDE options as well as tips and tricks.
$7.99 $5.99 25%

The Visual LISP Developer's Bible: 1st Edition

The Original. The e-book that started it all for me. 
$4.99 $2.99 40%

The AutoCAD Network Administrator's Bible: 2013 Edition

Setting up FlexLM and network licensing. Building, Testing and Deploying Autodesk 2013 products (aka "Deployments"), logs, option files, troubleshooting and more.
$9.99 $7.99 20%

The AutoCAD Network Administrator's Bible: 2012 Edition

Setting up FlexLM and network licensing. Building, Testing and Deploying Autodesk 2012 products (aka "Deployments"), logs, option files, troubleshooting and more.
$6.99 $4.99 30%

The AutoCAD Network Administrator's Bible: 2011 Edition

Setting up FlexLM and network licensing. Building, Testing and Deploying Autodesk 2011 products (aka "Deployments"), logs, option files, troubleshooting and more.
$3.99 $2.99 25%

In addition: Some of my e-Books which were not enrolled in the Amazon KDP Select program, are now enrolled! 


Q & A (Questions and Answers)

How Long will this Discount Offer Last?  These prices will remain in effect until August 10, 2013, or roughly 16 days from when the new prices go into effect.  After that, they will be returned to their previous prices.

Do you need a Kindle to read these?  NO.  You can download a FREE Kindle Reader App for almost any mobile device.  You can also read them in almost any web browser using the Amazon Kindle Cloud Reader.

You can read these, using a FREE reader app, on your iPhone, iTablet, iPod, Blackberry, Android device, Windows device, and more.

What Locations will see these Discounts?  The new prices will go into effect in all markets in which Amazon applies international currency conversions.  If you live or reside in a location which is not handled by their automated currency conversion process,  you will see whatever discount is applied as a derived translation of the U.S. Dollar value, as best as I can figure out. 

The markets which are covered by their automatic conversion process, as of now,  include: The United States, United Kingdom, France, Germany, Spain, Italy, India, Japan, Brazil, and Canada.  For more information, visit the Amazon web site and be sure to drink plenty of caffeine.

What does this "KDP Select" stuff mean?  It means Amazon Prime members can LEND and BORROW those e-books for FREE.  Yes.  For Free!  Ok, well, becoming an Amazon Prime member isn't really "free", but it does give you some pretty darn amazing discounts and cool features you can't get otherwise.

How Many of my e-Books are enrolled in this "KDP Select" program for Amazon Prime members to benefit from?  All of them.  If you find any that are not available for lending and borrowing on Amazon Prime as of July 26, 2013, please post a comment here and let me know!

How do I know which books are written by this same "David M. Stein"?  I've been told there are other "David Stein" authors out there, some with rather interesting tastes in book topics.  Rest assured that I have only written the books you see listed on my Kindle Author's page

Why am I doing this?  It's simple:  I have four kids still living at home, and my car is pretty darn old.  So you can rest assured that while you save money, and stuff your brain with new information, you're also helping a good cause.

Saturday, September 15, 2012

Why Comparing Visual LISP to VBA is a Waste of Time

Warning: This post is going to go so nerdishly geeky - that even I might have to put new tape on my glasses.

Jimmy Bergmark posted a really cool (and useful) tabular comparison of functions/methods between Visual LISP and VBA as of AutoCAD 2013.  It stirred up some thoughts, and emotions, in me about the path each language has taken (or not taken).

As I scanned my eyeballs down each row, the three functions that caught my eye were: (apply), (lambda) and (mapcar).  I will get to (defun) later.  And (cond) makes (select/case) look like a kid's toy.  I won't even dive into (eval), (quote) or (read).

If you're not familiar with LISP (of any flavor) these probably mean nothing.  I spent many years working with that language, even when idiots snickered and made their usual stupid acronym jokes about it (nerds can be so insensitive).  However, if you were an art collector, this would be similar to dropping names like Renoir, DaVinci, and Picasso.  Or if you were a musician, like dropping names Tchaikovsky, Beethoven or Zappa.  Or if you were a writer, like dropping names Shakespeare, Heinlein or, well, you get the idea.

These three functions are EXTREMELY powerful.  They can do things that NOTHING in VB or VBA or even VB.NET can do natively.  NOTHING.  Sure, you can mimic them with a LOT of code, but in the end, at the very bottom of the process stack (or heap), they will never be the same.

LISP is by nature flexible.  But it's also dynamic.  There is a difference, even though the implications of these two adjectives overlap quite often.

If you want to pause right here to do some poking around about these functions, I'll even offer some help:

  • Kenny Ramage posted a nice tutorial on (mapcar) and (lambda) here
  • Common LISP web site has a nice breakdown of (apply) here
  • Autodesk AutoCAD 2013 documentation section on (defun) here

Now, before you start into how (vlax-make-safearray) copies from Array(), I'll just go ahead and say that Array() is about as sophisticated against (cons) and (list) as a pile of toothpicks next to a fully-constructed log cabin.  In fact, if you want to be honest (and don't we all?), then (vlax-make-safearray) was nothing more than LISP having to be dumbed down to communicate with COM properly. Ok.  There.  I said it. (drops the microphone, hands in the air, walks off stage slowly...)

Function and End Function are about as similar to (defun) as the "fun" part, and that's about it.  The Function() declaration is static at runtime.  (defun) on the otherhand is completely dynamic and adaptable.  (defun) can be redefined at runtime, at-will.  Imagine trying to do this in VBA...

(defun MyFunction (a b c)
   (if (> a b)
      (defun MyFunction (a b c) (* a c))
      (defun MyFunction (a b c) (* b c))
   )
)

Is that a "great" example?  No.  It's just a 101 basic example.  But it exemplifies just how different these languages are.

IMPORTANT STUFF HERE...

Am I trying to say LISP is "better" than VB or VBA?

NO.

Programming languages are TOOLS.  They were always conceived and built to solve a particular set of challenges.  In most cases, when used for those very same challenges, they are ideally suited for the task.  Case in point:  Performing massively nested string manipulation in Perl or C++.  I'd take Perl any day of the week and twice on Sunday.

The original AutoCAD team (John Walker and the boys) selected LISP for a variety of reasons, but mostly because it was the most flexible language at the time. In many respects, it still is.  Particularly as it pertains (say that ten times!) to working with CAD drawings, graphic entities, precision, and object association.  But it lost it's sex appeal in the marketplace, which is unfortunate, but it was not a surprise either.

Before I start sounding like one of those guys that moans about how VHS beat out Betamax, let me say that I can see why that happened: It boils down to marketing, or the lack thereof.  Let's face it: the LISP community wasn't as interested in getting their platform onto every consumer device as earnestly as the Java folks were during the IT boom of the 90's.  Java had Sun doing its cheer-leading.  LISP had a bunch of unorganized nerds who could care less about what the "industry" wanted to do with it, so long as they could finish up their thesis lab work at 2:00 am.

Is LISP (or AutoLISP or Visual LISP) without imperfections?  No.  It could use quite a bit of TLC and modernization (especially within the narrow context of AutoCAD implementation), but it's much too constrained to be a smart business move.  Why spend more dollars on a language with fewer developers involved, when you can adopt and adapt a much more widely-used language like C#?  It just makes better business sense.

For what it's worth:  If I were handed a truckload of cash, and given the authority to direct some improvements to Visual LISP, well, I could hammer out a pretty good wishlist.  But nobody is listening anyway, so why bother?

Ok, since you asked:  Clean up the (car) (cdr) (cddr) (cdar) (cddr) (cdddr) (cddddddddr) mess.  Rename and consolidate functions to shorten the names (vlax-blah-blah-blah...).  Replace the IDE with something more recently styled.  Recode and rename the (vl-catch-all-apply) and (vl-catch-all-error-p) mess to bring it all more inline with Try/Catch/Fail, etc.  Make reactors easier to manage (like VB/VBA events).  Oh, my head hurts already.  Enough!  I can't go on.

I'm venting a bit, obviously.  And if I've upset or offended anyone who clings to their chosen programming language, I apologize.  Ok, not really, but I certainly don't want to make anyone angry.  Ok, maybe too late for that too.  Oh well.

Have a beer and enjoy the rest of your evening?

Sunday, April 1, 2012

VLDB Code Example: Registry Functions

Basic examples of VLISP registry functions (vl-registry-write) and (vl-registry-read).  Note the double backslashes, which is common for escaped string characters in LISP...

(vl-registry-write "HKEY_CURRENT_USER\\Example1" "FOO" "123")

Result: "123"

(vl-registry-read "HKEY_CURRENT_USER\\Example1" "FOO")

Result: "123"

(vl-registry-read "HKEY_CURRENT_USER\\Example1")

Result: nil

(vl-registry-write "HKEY_CURRENT_USER\\Example2" "" "ABCDEF")

Result: "ABCDEF"

(vl-registry-read "HKEY_CURRENT_USER\\Example2")

Result: "ABCDEF"

A simple abstracted "get" and "set" function pair using a custom Registry base location...

(setq G$REGROOT "HKEY_CURRENT_USER\\Software\\MyApplication\\")

(defun RegGet (key default / val)
    (if (= nil (setq val (vl-registry-read (strcat G$REGROOT key))))
        (progn
            (RegSet key default)
            (setq val (vl-registry-read (strcat G$REGROOT key)))
        )
    )
    (if val val default)
)

(defun RegSet (key val)
    (vl-registry-write (strcat G$REGROOT key) "" val)
)

Saturday, March 31, 2012

VLDB Code Example: Reload Profile From .ARG

Another set of code from Chapter 19, of my book "The Visual LISP Developer's Bible (2011 Edition)" available on Amazon for Kindle and Kindle Reader apps.  This one reloads an existing AutoCAD Profile from a source .ARG file.  As you may know, if you load an .ARG file, it is imported into the Registry.  Each time you launch AutoCAD, if the shortcut or command line specifies /P to specify a Profile (even a full path to an .ARG file) if a Profile already exists (by the same name) in the Registry, the .ARG file is ignored and the Profile is loaded from the Registry.  This is pretty much the same way a web browser cache works when loading stored images.  If you want it to force a reload from the source .ARG file, here's one way to do it...

;;; Reloads a profile from an ARG file
;;; Replaces existing profile if defined
;;; Returns profile name if successful, otherwise returns nil

(defun Profile-Reload (name ARGname / bogus)
    (cond
        ( (and
            (Profile-Exists-p name)
            (findfile ARGname)
        )
            (if (/= (strcase name) (strcase (vla-get-ActiveProfile (AcadProfiles))))
                (Profile-Delete name)
                (progn
                    (setq bogus "bogus")
                    (Profile-Rename name bogus)
                )
            )
            (Profile-Import name ARGname)
            (vla-put-ActiveProfile (AcadProfiles) name)
            (if bogus (Profile-Delete bogus))
                name
        )
        ( (and
            (not (Profile-Exists-p name))
            (findfile ARGname)
        )
            (Profile-Import name ARGname)
            (vla-put-ActiveProfile (AcadProfiles) name) 
            name
        )
        ( (not (findfile ARGname))
            (princ (strcat "\nCannot locate ARG source: " ARGname)) nil
        )
    )
)

;;; Renames an existing profile
;;; Returns new profile name if successful, otherwise returns nil

(defun Profile-Rename (from to / result)
    (if (Profile-Exists-p from)
        (if (not (Profile-Exists-p to))
            (cond
                ( (not
                    (vl-catch-all-error-p
                        (setq result
                            (vl-catch-all-apply
                                'vla-RenameProfile
                                (list (AcadProfiles) from to)
                            )
                        )
                    )
                ) to ; Return new name if successful!
            )
        )
    )
)

;;; Deletes an existing profile
;;; Returns T if successful, otherwise returns nil

(defun Profile-Delete (strName / result)
    (if (Profile-Exists-p strName)
        (cond
            ( (not
                (vl-catch-all-error-p
                    (setq result
                        (vl-catch-all-apply
                            'vla-DeleteProfile
                            (list (AcadProfiles) strName)
                        )
                    )
                )
            )
            T ; return T for success!
            )
        )
    )
)

;;; Imports a profile from a given ARG file
;;; Returns profile name if successful, otherwise returns nil

(defun Profile-Import (argFile strName / result)
    (cond
        ( (findfile argFile)
            (cond
                ( (not
                    (vl-catch-all-error-p
                        (setq result
                            (vl-catch-all-apply
                                'vla-ImportProfile
                                (list (AcadProfiles) strName argFile vlax-True)
                            )
                        )
                    )
                )
                strName ; return new profile name if successful!
                )
            )
        )
    )
)

;;; Determine if profile name is already defined (exists)
;;; Returns T or nil

(defun Profile-Exists-p (name)
    (get-item (AcadProfiles) name)
)

;;; Return Profiles collection object

(defun AcadProfiles () 
    (vla-get-profiles (vla-get-preferences (vlax-get-acad-object)))
)

The Visual LISP Developers Bible – 2011 Edition
http://sites.google.com/site/visuallispbible
Copyright ©2002-2010 David M. Stein, All Rights Reserved.

VLDB Code Example: Purge All Opened Drawings

This little chunk of code will run a Purge on all drawings currently opened in your editor.

(defun AllDocs-Purge ( / docs)
    (vlax-for dwg (vla-get-Documents (vlax-get-acad-object))
        (vla-PurgeAll dwg)
    )
)

Wednesday, March 28, 2012

VLISP Housecleaning: Example 2

Here is another example from my ebook, "The Visual LISP Developer's Bible, 2011 Edition" (Amazon Kindle).  This one demonstrates a shell process, whereby the code executes an external COM interface request to use VBscript to perform a simple date calculation.

(defun daysold (d / sc cmd result)
    (setq sc (vlax-create-object "ScriptControl"))
    (vlax-put-property sc 'Language "vbscript") 
    (setq cmd (strcat "DateDiff(\"d\", \"" d "\", Now)" )) 
    (setq result (vlax-invoke-method sc 'Eval cmd)) 
    (vlax-release-object sc) 
    (eval result) 
)

(setq age (daysold "12/1/2010"))

You can do the same with JavaScript (actually JScript) as well.

VLISP House Cleaning Project

I've said before that I'm pretty much retired from writing books about AutoCAD or AutoLISP/VisualLISP, but I still get e-mail from readers asking for help or to share some code.  So, since it's not exactly ideal to make use of the code in my ebooks, I've decided I will post some (not all) of the examples from "The Visual LISP Developer's Bible, 2011 Edition" on my blog over the coming weeks.  As time permits, anyway.

To kick this off, here's the example from Chapter 21, exporting a drawing layers table to an Excel spreadsheet using Visual LISP and the COM interface...

(vl-load-com)
(setq acad (vlax-get-acad-object)) 
(setq activeDoc (vla-get-ActiveDocument acad)) 
(setq layers (vla-get-Layers activeDoc))
(setq excel (vlax-create-object "Excel.Application"))
(setq workbooks (vlax-get-property excel 'Workbooks))

(princ "\nSetting visible to True")
(vlax-put-property excel 'Visible :vlax-true)

(princ "\nGetting active workbook...")
(vlax-invoke-method workbooks 'Add)
(setq workbook (vlax-get-property excel 'ActiveWorkbook))

(princ "\nGetting active worksheet...")
(setq sheet (vlax-get-property excel 'Activesheet))

(princ "\nRename active worksheet...")
(vlax-put-property sheet 'Name "Layers")

(princ "\nGetting cells...")
(setq cells (vlax-get-property sheet 'Cells))

(princ "\nPrinting column headings...")
(vlax-put-property cells 'Item 1 1 "LayerName")
(vlax-put-property cells 'Item 1 2 "Color")
(vlax-put-property cells 'Item 1 3 "Linetype")

(princ "\nPopulating cells...")
(setq row 2)
(vlax-for layer layers
 (vlax-put-property cells 'Item row 1 (vla-get-Name layer))
 (vlax-put-property cells 'Item row 2 (itoa (vla-get-Color layer)))
 (vlax-put-property cells 'Item row 3 (vla-get-Linetype layer))
 (setq row (1+ row))
)

(princ "\nSaving workbook...")
(vlax-invoke-method workbook 'Save)
(vlax-invoke-method workbooks 'Close)
(vlax-invoke-method excel 'Quit)
(foreach obj (list cells sheet workbook workbooks excel)
 (vlax-release-object obj)
)
(gc)
(prince "\nDone!")

Tuesday, October 11, 2011

What if AutoLISP were Unleashed?

forkInTheRoadWay back when, (a completely meaningless phrase of course), Autodesk had the audacity to introduce a radically new concept into a software product: Extensive Programmability.  They did that using DIESEL, AutoLISP, and the MNU file.  They could have just dropped a “here-you-go-take-it-as-is” product without any meaningful customization features or tools, but they didn’t.  Autodesk instead decided to empower their customers, enabling them to extend and reshape their products to suit their own needs.  This simple decision had a profound impact on their customer base, as well as product sales. Indeed, it created an entire community and industry that otherwise wouldn’t have existed.

I’ll spare you the regurgitated history stuff, you can look that up online.

There is something that has been ticking around in the back of my head for a long time:
   What if Autodesk had ported the AutoLISP platform outside of AutoCAD?

Keep in mind that this was in the 1980’s, and Java didn’t yet exist, neither did .NET.  The most popular “cross-platform” scripting toolset at the time was Perl (and ActivePerl). Most AutoLISP programmers I knew between 1988 and 1995 were always wishing for more OS features, many of which were made possible through third-party tools like Robert McNeel’s DOSlib. There were also many that begged for a better dialog programming toolset, which was later made possible by OpenDCL, another third-party product.

Autodesk however had other desires.  They were starting to drink the Microsoft Kool-Aid, and decided to drop LISP at the altar and run off to Vegas with VBA.  After all, she was hotter and wore thongs and high heels at the time.  Then when VBA put on a few pounds and started wearing sweats around the house without make-up, they ran off to Bangkok with the svelte .NET, along with a crate of condoms and a case of Bud.  LISP was left in the alley, panhandling for spare change, needle tracks were starting to show on her arms.  AutoLISP was swapped with Visual LISP, which remains to this day, but is ignored in much the same way as Middle Class workers are in America.  The world of AutoCAD customization now belongs to ObjectARX, or so we're told.

I won't go into the flaws with this mindset of ObjectARX over LISP, but I know that I'm not alone in feeling it's a huge mistake to ignore Visual LISP they way it's been ignored thus far.

But what if?  What if not only had they continued to breathe life into Visual LISP, but they had made it possible to run AutoLISP code from a dedicated script engine from outside AutoCAD?  I'm talking about much like was/is possible using ActivePerl, KiXtart, CMD or VBScript.  Imagine the power that thing could’ve unleashed for LISP programmers.  I can only imagine the potential it could have had for much more than batch processing of DWG files.  Granted, the constraints of AutoLISP capabilities would have required a significant amount of expansion, which was in short supply after the acquisition of Vital LISP® was renamed Visual LISP®.  It was as if they had adopted a 3 year old child who spoke an unknown language, so they left him alone in the toy room with the dog, tossing food on the floor, and quickly shutting the door.
Imagine the potential of combining the file system features of DOSlib with the dialog building features of OpenDCL with powerful intrinsic functions like (mapcar), (apply) and (lambda).  In case you need a poke in the brain: Remember that LISP is built for recursion and that file systems are perfect for recursive operations.  Not just file systems either, but any data source.

The basic tenants were fairly unimpressive: a script engine that is ported to various “present day” platforms (Windows, OSX, Linux) which executes the same code the same way. Gee.  That sounds a bit like Java.  That also sounds like .NET, sort of, maybe more like Project Mono.  But those two platforms weren't even concepts in 1990.  In any case, you get the idea.  That is, if you’re still awake and reading this far.  I’m guessing few of you have read this far without falling asleep or moving on to something more interesting.
Alas, this idea was never on the table, officially, so it never could’ve become reality.  Never mind that there haven't been any meaningful updates to VLIDE or Visual LISP in years.  I'm still a pie-in-the-sky person, and I'm often given to dream crazy things.

Saturday, August 20, 2011

Book Pricing Announcement

Since I've decided to retire from writing books on Autodesk products and technologies, I'm going to be making some adjustments to pricing for them as well.  The following Kindle E-Book titles will be re-priced immediately:

The AutoCAD Network Administrator's Bible, 2012 Edition (was $7.99, now $6.99)

The AutoCAD Network Administrator's Bible, 2011 Edition  (was $4.99, now $3.99)

The Visual LISP Developer's Bible, 2011 Edition  (was $7.99, now $6.99)

The Visual LISP Developer's Bible, 2003 Edition  (was $4.99, now $3.99)

The Packagers Pocket Reference  (still only $2.99)

These price changes were submitted very recently, and may not have updated in Amazon's database yet.  If the prices are still the "was" price shown above, visit the Amazon page again after a few hours or a day to allow time for it to update.  As always: Thank you for supporting my work and purchasing my books.  It has really meant a lot to me and has helped me through some tough times.

Tuesday, March 1, 2011

Facebook

I forgot to mention that there's a Facebook Group for "Visual LISP Developers".  The link is http://www.facebook.com/group.php?gid=339867788546 but you also search for "Visual LISP" and find it.

Tuesday, February 15, 2011

What Goes Up…

Like cell phones, hard drives, wireless routers, thumb drives, GPS devices, digital cameras and pizza delivery, eventually their prices comes down due to competition and lower demand related to anticipation of the next release.  Just like those things, my book have also come down in price…

The AutoCAD Network Administrator's Bible, 2011 Edition
for Amazon Kindle and Kindle Reader apps….   Now only $7.99

The Visual LISP Developer's Bible, 2011 Edition
for Amazon Kindle and Kindle Reader apps….   Now only $7.99

Packager's Pocket Reference
for Amazon Kindle and Kindle Reader apps….   Now only $2.99

For those of you that read any of these books, please rate them on Amazon and let others know what you think of them.  Be honest. But please keep it civilized. :)

Saturday, January 8, 2011

The Visual LISP Developer's Bible, 2011 Edition

I would have posted this sooner, but I'm still barely out of bed with the Flu and bronchitis.  I hate Winter.  This was actually available a day ago but I've been medicated and sleeping.  I'm going back to bed now.  I hope you like this.  I put a lot of work into it and Phill Ash put a lot of editing/proofing time in as well.

The Kindle e-Book: http://www.amazon.com/dp/B004I43BFK

The Web Site: https://sites.google.com/site/visuallispbible/home

Thursday, December 9, 2010

My Favorite Scripting/Programming Languages

Just random blabbering stuff.  These are ranked in order of "most fun" to "least fun" to work with (entirely subjective of course)…

  1. KiXtart 4.6x
  2. PHP 5.x
  3. VBScript / ASP
  4. SQL / T-SQL
  5. Wise Script 8
  6. Javascript
  7. Visual LISP / AutoLISP
  8. BAT / CMD
  9. PowerShell v2
  10. VB.NET

Ordered by what I work with most often:

  1. BAT / CMD
  2. VBScript / ASP
  3. Wise Script 8
  4. SQL / T-SQL
  5. Javascript
  6. PHP 5.x (sad, very sad for me)
  7. PowerShell v2 (this might change soon)
  8. KiXtart 4.6x (oh, the agony!)
  9. Visual LISP / AutoLISP (almost never)
  10. VB.NET (almost never)

Wednesday, November 24, 2010

B-b-b-b-b-books

My book on Visual LISP Development, aptly named "The Visual LISP Developer's Bible" has been submitted to Amazon's Self-Publishing program for approval. If approved, it will be available for eBook download at the ridiculously cheap price of $4.99 (USD). If you care to prevent the starvation of my toothless and shoeless children, you will consider skipping one Starbucks to buy this outdated book. My busload of poor children will thank you from the bottom of their empty stomachs.


Now for some even really gooder news! I am writing another book! Yes. It's true. They allow me to touch a keyboard still. What's it on, you ask? Why, it's going to be about deploying and managing Autodesk software products in a Windows network environment and using things like scripting, and Configuration Manager and dozens of trips to Starbucks and the nearby bars. It will be loads of action-packed excitement and adventure. Stay tuned!

Wednesday, October 27, 2010

Visual LISP Developer’s Bible - RIP

Given that AutoLISP and VisualLISP are essentially dead programming languages, I decided to pull the plug on the hopes of reviving and updating my eBook “The Visual LISP Developer’s Bible”.  But what strikes me as strange is that the visitor traffic to that web site has been rising steadily ever since.  If anyone knows why please let me know?  I’m curious.  I still don’t have any plans to revive it, but I also don’t think it will be deleted anytime soon (unless Google decides for me).

Logo

I’ve said it before and I’ll probably keep saying it when I’ve had too much to drink: I miss working with Visual LISP.  I really think it has (had) potential to stand on its own, outside of AutoCAD.  I would rather use it for cross-platform scripting than Java, Perl or PowerShell (that was a joke obviously.  PowerShell only works on one platform).  Dynamic functions, mapcar and lambda, self-defining expressions, ooohh, oh, I gotta stop.  I may need to find a box of Kleenex.

Tuesday, September 7, 2010

Visual LISP (and AutoLISP) is Officially Dead

I'm sure some of you will disagree, but it's true.  Autodesk will never admit it, but it's true.  Ever since they fell in love with VBA, and got dumped in an alley by VSA, and then thought it would somehow catch on with the masses of casual programmers (those of us trying to get a job done, and programming code JUST ENOUGH to make the job easier and quicker).  Even though there are still (last I checked) some chores that ObjectARX (.NET) still can't do as well, or as "elegantly" as LISP, they're not going on a second date.  She's been dumped.  Bon voyage LISP.  It was a wonderful journey.  I will miss you.

PS.  The Visual LISP Developer's Bible project is officially comatose with no brain activity.

Monday, May 25, 2009

Efficiency at the Cost of Freedom?

This is indeed a mindless rant.

When you get used to something and then it's no longer around, it can be a bit irritating to deal with. That's as true for programming as anything else in life. I bounce between several scripting languages, but mostly KiXtart, VBScript and PowerShell (as if you couldn't tell from my mindless rants already). But prior to this I worked primarily with LISP (AutoLISP and some CommonLISP or Franz LISP, no not Franz Liszt). One thing I run into quite often is the rather limiting single-expression nature of SELECT CASE or SWITCH CASE or SWITCH {} or whatever. I was used to the (COND) statement in LISP, and it was good.

Most people that have never used (cond) look at the code examples I give them and smirk to each other and say something like "so?". But imagine if PowerShell suddenly removed the "default" option from the Switch{} statement? Sure, you could code around that, but you'd probably ask yourself (or some other helpless victim at the coffee mess) "what happened to it? my precious?  why did they take it away?" at least once, anyway.
Here's an example of PowerShell vs LISP switch-case condition branching:
switch ($a) {
1 {action...}
2 {action...}
"a" {action...}
default {action...}
}




I don’t mean to pick on PowerShell.  It’s just the example I chose from a hat (ok, proverbially speaking, my hat is the size of my head, which isn’t big enough to hold more than one example).  The variable $a is the driving (determinant) variable which is being evaluated.   VBScript takes a similar approach…


Select Case a
Case 1: action...
Case 2: action...
Case "a": action...
Else: action...
End Select


It’s funny (ok, to me anyway) that some uses of VBScript look a lot like COBOL.  Wordy wordy wordy.


LISP doesn’t take that approach.  It lets you invoke a variable, or an expression, anywhere in the conditional branching.  This can save lines of code in many situations, and comes in handy for other things...




(cond
( (= a 1) (action...) )
( (expression) (action...) )
( (> (* a 500) 1000) (action...) )
( (= (setq x (expression)) "ABC") (action...) )
( T (action...) )
)





Metaphorically, or euphorically (coffee kicking in), having another capability opens up a world of potential for new directions and approaches to solving problems.  By the way, other useful features of LISP include statements like (mapcar), (apply) and my favorite of favorites (lambda). Of course, you can perform Lambda expressions in many languages. But sprinkling more LISPness on it you can easily code for conditional lambda definitions. You can also code for dynamic functions and dynamic recursion. Since most of the work I did "back then" was with respect to drawing geometry on screen, these kinds of capabilities really came in handy. Interpolating intersecting ellipse shapes and defining specific pick-points to perform explicit edit operations, all are much easier to do with these dynamic capabilities than with stronger-typed languages like VBA, VSA/VB.NET or even C#.



It seems that the dynamic, fluid, free-form aspect of languages are giving way to more strongly typed, rigidly defined languages like the .NET family and even Ruby, Python, etc. Seems odd that we wait until 2009 to get all clean-shaven in wrapped in a suit with our programming, when software and hardware advancements have all but eliminated the performance overhead "drag" we worried so much about in the 1990's. Sure, I know that there are situations where that gap is noticeable, but I've seen some insane number crunching in my time, and the relativity factor is almost laughable when it comes to desktop computing. There were "problems" that in the 90's required parallel Cray boxes to crunch for days, even weeks, to achieve a result. That same problem category can be solved on a standard HP/Dell desktop now for under a thousand dollars (USD). The performance overhead gap has shrunk to miniscule scale. So, rather than focusing on processor efficiency, why don't we instead focus on the human nature of coding? Get rid of strong typing. Leave that for compiled languages.



Even if it's not practical to remove the pre-compile definition of variables, which I think is absurd, why can't we at least make the compiler/runtime smart enough to read variable names to interpret symbol types? iSomething could easily guide the JIT or compiler to define as "Integer".  sSomething = string/char type.  dSomething = date value, and so on.  Save a line of code here and there. And get rid of DIM and SET and GET. Why we have GET and SET for the same objects and classes in 2009 is beyond me.


In 1995 we were writing C++ class templates in college, which overloaded functions based on a return value. It's not that difficult. So you could GET or SET with the same line of code, but the one that captured a return value into a variable was the one that invoked the GET member of the class.  Why are we still having to explicitly tell the compiler/runtime what we’re doing?  What we need to include or import?  This just seems like we’re going backwards.  Is it really 2009? It seems more like 1999.

I told you it was a mindless rant. I had too much coffee and someone let me near a keyboard. That was a mistake. :)

Friday, September 19, 2008

Another Segment of the John Walker Interview

Kean Walmsley has posted part 2 of a 4-part interview with Autodesk co-founder John Walker. This one dives a bit deeper into the reasons behind, the and history of, extending AutoCAD with a programmable interface. I couldn't agree more with John's comments on programming language advantages and the references to things having been done before and simply re-discovered. How true!

I've always preferred LISP over other programming languages. It's just a fun language to work with and arguably one of the most flexible to work with. What other languages allow you, no, compel you, to develop a program that can reprogram itself at runtime? I'm not talking about conditional branching, but actual, true dynamic self-definition. Code that writes itself as needed. If you have ever worked with LISP for more than a few months you know what I'm talking about. Combining (defun) with (mapcar), (lambda) and (apply) and a pinch of recursion, and BOOM you have some really incredible stuff to leverage.

I was learning LISP, and XLISP while in college, but AutoLISP really injected me with a dose of enthusiasm because it was the first time I was able to combine raw programming with graphical output. At the same time, I was having to develop projects at school in C++ and Java, but those felt like a dull chore. Employee database tables with "employee" objects and class templates. Objects are definitely cool, but LISP is cooler (to me anyway). The list paradigm sort of compares to working with nothing but class templates, but with less effort and constraint. Oh well. There's nothing for a LISP programmer around here anymore. Even my old book fell into obscurity, but hey, PHP is cool (and still free), as are true scripting tools like VBscript, and KixTart. PowerShell to me feels like C# (translation: "work", not "fun"). Maybe when it matures and becomes more pervasive I will see it differently. But right now, you can't use it to do login scripts or web development as easy as you can with VBscript (still the crux of ASP) or KixTart, or even BAT/CMD. It's definitely more powerful, but comes with a complexity price tag.

I digressed horribly here. Sorry. :(

Monday, June 30, 2008

The Housecleaning Continues

I'm cutting loose of baggage and it feels good. I could write a 70s ballad using those words I think. Probably not.

I finally put a fork in VLDB and DCIS and they are gone. I was so tired of dragging those around for no good reason whatsoever. I created a burden and have learned to let it go. I'm on fire now. Some domains I have registered will be let go as well. Tired of dragging them along (and paying) for no reason. Time is too short to spend on that crap. My steinvb.com site is gone. I will keep steinvb.net as long as it takes me to find a suitable family/group secured but shared calendar, document and list sharing site that doesn't cost too much. Once that's taken care of, I will only have two domains to maintain: vblife.net and harmonixx.com. VBlife may only survive until it expires next year, I'll have to wait and see. Harmonixx is going well so I plan on keeping it going for now. A lot will depend on the economy and so forth.

Tuesday, June 24, 2008

House Cleaning: VLDB, DCIS go bye-bye

After years of dragging baggage around, it feels good to cut things loose. The ill-fated book attempt I made for "The Visual LISP Developer's Bible" is one. The other is my lame-o "Dave's Computer Inventory System (DCIS)". Both have been relegated to history, if they ever had a history. No more stupid attempts to make something like those again. I learned some powerful lessons with those projects.