TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Logan on May 18, 2017, 02:23:55 PM

Title: read external function
Post by: Logan on May 18, 2017, 02:23:55 PM
Hello guys
Has anyone ever had to do something like that?

Code: [Select]
(defun c:test (/ return strFun)
  (setq strFun "(lambda (x y / return) (+ x y))") ;read external file
  (setq return (eval (list(read strFun) 4 2)))
) ;_ >defun
(princ)

For curiosity
Could you tell me if there is any advantage or disadvantage to this method?

I'm sorry if my question is not relevant.  :roll:

Best Regards, Luís Augusto
Title: Re: read external function
Post by: roy_043 on May 19, 2017, 04:28:54 AM
I do not see any advantage over using (load).
Title: Re: read external function
Post by: Logan on May 19, 2017, 01:12:43 PM
Many thanks Roy
I'm sorry for the delay in replying.

Because I had never seen this anywhere else, I imagined there was no advantage.
I imagined using it in conjunction with "vla-GetRemoteFile" and an de/encryption routine.

I have no real use for it, just fertile imagination.
Thank you very much for responding.

If anybody else has any comments, please.
It is always good to learn from this forum.
Title: Re: read external function
Post by: VovKa on May 19, 2017, 05:58:29 PM
Lisp is not a 'secure' language, encyption does not make much sense.
Title: Re: read external function
Post by: Logan on May 23, 2017, 04:04:49 PM
Thanks for the reply Vovka
You're right.

I really do not have a purpose with this code, just hope to learn a little more with you and hear sincere opinions like yours.

Here in this forum are the best heads when it comes to programming using autolisp.

I really do not know why anyone would have variable functions from outside source.  :idiot2: