Author Topic: read external function  (Read 1685 times)

0 Members and 1 Guest are viewing this topic.

Logan

  • Newt
  • Posts: 41
read external function
« 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

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: read external function
« Reply #1 on: May 19, 2017, 04:28:54 AM »
I do not see any advantage over using (load).

Logan

  • Newt
  • Posts: 41
Re: read external function
« Reply #2 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.

VovKa

  • Water Moccasin
  • Posts: 1626
  • Ukraine
Re: read external function
« Reply #3 on: May 19, 2017, 05:58:29 PM »
Lisp is not a 'secure' language, encyption does not make much sense.

Logan

  • Newt
  • Posts: 41
Re: read external function
« Reply #4 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: