Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Visual Lisp vs Auto Lisp

23 REPLIES 23
Reply
Message 1 of 24
Anonymous
834 Views, 23 Replies

Visual Lisp vs Auto Lisp

Hello,
What is the difference between visual lisp and auto lisp?
George
23 REPLIES 23
Message 21 of 24
Anonymous
in reply to: Anonymous

Doug, --

great idea! I forgot we can do almost anything now that we have
vl-catch-all-apply. 🙂

One problem though ----- after you get to the right number of arguments
it will actually work, and there's no telling what it could do.

Ex.:

(defun test(a b c)
(vlxxx-format-disk-c-no-warning))

Granted, the probability is very low, but not zero.

I thought to try to stop the execution by passing (/ 0 0) into it,
but the arguments get evaluated in Vlisp _before_ there's an
attempt to pass them to function call:

Command: (defun foo ( a b c ) 1)
FOO
Command: (foo 1)
; error: too few arguments
Command: (foo 1 (print 2))
2 ; error: too few arguments
Command: (foo 1 (/ 0 0))
; error: divide by zero

I begin to remember now, I once tried similar approach but
this problem stopped me. 😐

VLIDE obviously has the access to this info, it shows on its inspect
windows for USUBR objects. Now _how_ can we persuade ADESK
to tell us about it?.... Anyone?......



Doug Broad wrote in message
news:8431D33A77A628F4B6811DD27B8AE07A@in.WebX.maYIadrTaRb...
> Vladimir,
>
> Here's a kludgy approach to arity. Can you think of a better way?
> This really should be named MinArity since some built in functions
> have a flexible number of arguments. Can you think of a function
> definitions for Fixed-Arity-P or for Max-Arity or perhaps Arity-OK?
>
> (defun arity (fun / rv al i);D. C. Broad, Jr. 2002
> ;rv - return val, al - arg list, i - # of args
> (setq i 0)
> (while
> (and
> (vl-catch-all-error-p
> (setq rv (vl-catch-all-apply fun al)))
> (= "too few arguments" (vl-catch-all-error-message rv)))
> (setq al (cons 'a al) i (1+ i)))
> i)
>
> ;Example
> (defun myfun (a b c) (princ (+ a b c)))
> (arity 'myfun)
> 3
>
> Doug
>
> "Vladimir Nesterovsky" wrote in message
> news:B8C9BA096C1ECC57DDC631DC5AE00EBC@in.WebX.maYIadrTaRb...
>
> > Can you think of some way to find out the "arity" of a Vlisp
> > subroutine? ("arity" is a number of arguments it's expecting).
> > This can be useful in lisp profiling for run-time function redefinition.
>
>
>
Message 22 of 24
Anonymous
in reply to: Anonymous

Vladimir,
Eeeewww! Gives me the creeps just thinking of the implications.
Guess you are right. You certainly don't want to
feed this function a list from atomsfamily to map out all the arg lists for
all functions. There might be some dangerous functions out there
that have no arguments. For the rest, I was feeding arguments that
should normally cause termination for other reasons. Few functions will
take only symbol arguments. But the risk is too great for wholesale
use.

It could still be used judiciously to determine the arity of
functions whose purpose(by name) is relatively clear. A clear
determination of a function's purpose and side-effects though is as
important as the number of arguments.

Now, where's that wish list???????

Regards,

Doug

"Vladimir Nesterovsky" wrote in message
news:B344801D2E6FD3FF2073DD3C0A0DF192@in.WebX.maYIadrTaRb...
> Doug, --
>
> great idea! I forgot we can do almost anything now that we have
> vl-catch-all-apply. 🙂
>
> One problem though ----- after you get to the right number of arguments
> it will actually work, and there's no telling what it could do.
>
> Ex.:
>
> (defun test(a b c)
> (vlxxx-format-disk-c-no-warning))
>
> Granted, the probability is very low, but not zero.
>
> I thought to try to stop the execution by passing (/ 0 0) into it,
> but the arguments get evaluated in Vlisp _before_ there's an
> attempt to pass them to function call:
>
> Command: (defun foo ( a b c ) 1)
> FOO
> Command: (foo 1)
> ; error: too few arguments
> Command: (foo 1 (print 2))
> 2 ; error: too few arguments
> Command: (foo 1 (/ 0 0))
> ; error: divide by zero
>
> I begin to remember now, I once tried similar approach but
> this problem stopped me. 😐
>
> VLIDE obviously has the access to this info, it shows on its inspect
> windows for USUBR objects. Now _how_ can we persuade ADESK
> to tell us about it?.... Anyone?......
>
>
>
> Doug Broad wrote in message
> news:8431D33A77A628F4B6811DD27B8AE07A@in.WebX.maYIadrTaRb...
> > Vladimir,
> >
Message 23 of 24
Anonymous
in reply to: Anonymous

Like gpal1 I would like to know the differences between Autolisp and V-lisp. I've been programming with Autolisp for twenty years but can 't make a lot of sense out of the answers given. I know about S::Startup V-lisp editor etc. but can't seem to find a simple tutorial to help me to upgrade to V-lisp. i.e. How does it work, what does it do that Autolisp doesn't and where can I find a function list etc.? Many thanks
Message 24 of 24
martti.halminen
in reply to: Anonymous


@Anonymous wrote:
Like gpal1 I would like to know the differences between Autolisp and V-lisp. I've been programming with Autolisp for twenty years but can 't make a lot of sense out of the answers given. I know about S::Startup V-lisp editor etc. but can't seem to find a simple tutorial to help me to upgrade to V-lisp. i.e. How does it work, what does it do that Autolisp doesn't and where can I find a function list etc.? Many thanks

Reading 12 years old discussion threads is likely to confuse you, there are plenty of more up-to-date discussions about this.

 

Typing "Visual Lisp" to the search box in this group finds about 2000 messages, selectively reading about a dozen of those would help a lot.

 

For example the recent discussion re "vla & vlax et. al." contains some good references to get started.

http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/vla-amp-vlax-et-al/m-p/4784341#U4784341

 

For an in-depth explanation I would recommend the book by Reinaldo N. Togores:

 

http://www.togores.net/autocadexpert

 

--

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost