明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 873|回复: 1

[经验] 在函数体内定义函数的作用

[复制链接]
发表于 2020-7-1 16:03:25 | 显示全部楼层 |阅读模式
本帖最后由 yxp 于 2020-7-1 17:19 编辑

  1. (defun fff1()
  2.     (alert "A:fff1")
  3. )
  4. (defun fff2()
  5.     (alert "A:fff2")
  6. )
  7. (defun c:f1( / fff1);//不添加fff2 fff3
  8.   (defun fff1()
  9.     (alert "B:fff1")
  10.   )
  11.   (defun fff2()
  12.     (alert "B:fff2")
  13.   )
  14.   (defun fff3()
  15.     (alert "B:fff3")
  16.   )  
  17.   (fff1)
  18.   (fff2)
  19.   (fff3)  
  20. )
  21. (fff1);alert "A:fff1"
  22. (fff2);alert "A:fff2"
  23. ;(fff3);报错
  24. (c:f1);alert "B:fff1" ->B:fff2->B:fff3
  25. (fff1);alert "A:fff1"
  26. (fff2);alert "B:fff2"  被c:f1重新定义了
  27. (fff3);alert "B:fff3"  执行c:f1,子函数加载成功。



您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-5-18 00:47 , Processed in 0.197981 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表