Results 1 to 2 of 2

Thread: how do you call other lisp routines with lisp?

  1. #1
    Member
    Join Date
    2011-01
    Posts
    3

    Default how do you call other lisp routines with lisp?

    I have a lisp file (learn.lsp), that has around 20 different lisps, or methods inside of it.
    If they followed the naming convention lispAlpha, lispBravo, lispCharlie, lispDelta, lispEcho etc, how could I call lispAlpha and lispBravo from lispEcho?

    would it look something like this?
    defun C:lispEcho (lispAlpha lispBravo)

    or is there a specific method to call other routines?

  2. #2
    I could stop if I wanted to marko_ribar's Avatar
    Join Date
    2004-06
    Location
    Belgrade, Serbia, Europe
    Posts
    414

    Default Re: how do you call other lisp routines with lisp?

    you just put in your lispEcho lines like this :

    Code:
    (defun c:lispEcho (... / ...)
    ...
    (c:lispAlpha)
    (c:lispBravo)
    ...
    (princ)
    )
    Now your routine lispEcho when time comes for recalling other lisps - when finds lines (c:lispAlpha) and (c:lispBravo), it will then execute these and after that resume till the end of its own...

    Note : All this is referenced on defined command functions like : (defun c:lispAlpha () ), but if defined functions are non-command like (defun lispAlpha (arg1 arg2 ... / var1 var2 ...) ), you have to put in your global lisp lines for calling these functions without c: option and provide values for functions arguments arg1 arg2 ... :
    Code:
    (defun c:lispEcho (... / ...)
    ...
    (lispAlpha value of arg1 value of arg2 ...)
    (lispBravo value of arg1 value of arg2 ...)
    ...
    (princ)
    )
    Last edited by marko_ribar; 2011-02-06 at 01:05 PM.

Similar Threads

  1. Replies: 9
    Last Post: 2012-01-21, 06:58 AM
  2. Lisp Routines
    By Shadrak in forum AutoCAD Customization
    Replies: 4
    Last Post: 2009-10-08, 01:32 AM
  3. Lisp Routines
    By jsnow in forum AutoCAD General
    Replies: 2
    Last Post: 2009-04-16, 05:07 AM
  4. organizing Lisp routines.
    By Gigliano70 in forum AutoLISP
    Replies: 5
    Last Post: 2008-11-04, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •