明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 20847|回复: 326

[【不死猫】] 更新!!掀开“桌子”,从CAD中挖掘出全部Lisp函数,普通及内部函数变量10000+

    [复制链接]
发表于 2022-8-15 13:09 | 显示全部楼层 |阅读模式
本帖最后由 不死猫 于 2022-8-16 11:32 编辑

近期在论坛看到有零散的内部函数公布,大家热情高涨,但个人研究毕竟能力有限,从内存翻找内部函数效率也很低,不如集思广益让更多的爱好者参与,所以猫老师把自己挖掘整理好的函数(普通+内部+全局变量)共享出来,一共5400余个,应该也是截至目前为止全网发布最多的原生AutoCAD-Lisp函数合集。
=============================
第一版发布后,重新整理发现了更多资源,共计10000多个,做一次更新。




猫老师的部分研究说明:
1. 结尾是p的,大多是用来判断是否某种类型的,所以可以根据这个找到一些内部类型。
例如我们平时有用的listp,这里可以找到例如vectorp(向量表判断)、usubrp(用户函数判断)、stringp(字符串判断)等等
2. 带叹号的函数有些和窗体有关
3. 前后星号是CAD全局变量
4. N开头的有些是破坏性函数(破坏性列表操作是指那些改变了内存单元内容的操作)
5. ac开头是常量
6. as:开头的是一些我们正常用到函数的内部名称,但是一些内部函数和现有函数名称相同但用法不同,使用时要注意
7. 冒号开头的是符号参数,我们平时用到比较多的是反应器里面



本套函数大全中有很多底层操作的函数,包括多种数据类型、内存读写、向量、命名空间、二进制、函数、变量、包、数据流、堆栈、缓冲区、矩阵、文件处理、com接口、数据库、动态链接库、丰富的字符串、表和数字处理等无法一一列举。


注意:很多函数的使用具有不可预见性,例如random&随机数获取,我在Lisp加密工具的早期版本中使用发现,循环调用80-100万次时(非单独循环调用),该函数会崩溃。另外有的函数受到操作系统、CAD版本的影响,功能和返回值会有变化,后续大家发布函数功能的时候需要注意测试!
抗反编译方面:因为内部函数在lsp中不能普遍存在,因此具有一点抗反编译能力。
某些函数不存在的问题:要加载特定的arx文件。


猫老师函数大全下载:
很多函数是继承原生lisp和C语言的,因为太多,未注明功能和参数。
第一版5475个

第二版
基于2006CAD,共计10127个

基于2021CAD,共计10948个
发一个我自己写的转换内部函数代码。
  1. (defun ggload(str / ado array f file_list fileget lst);猫老师内部函数生成
  2.   (setq out (strcat (getenv "UserProfile") "\\内部函数.fas"))
  3.   (if (findfile out)
  4.     (vl-file-delete out)
  5.   )
  6.   (setq lst (append
  7.   (list 13 70 65 83 52 45 70 73 76 69 59 195 168 192 207 202 166 13 49 13 49 32 36 7 36 13 )
  8.   (vl-string->list (itoa (+ 26 (strlen str) (strlen str))))
  9.   (list 32 50 32 36 )
  10.   (list 20 1 1 1 0 86 )
  11.   (vl-string->list str)
  12.   (list 0 0 91 )
  13.   (vl-string->list (vl-string-subst "-" "." str))
  14.   (list 0 0 1 67 0 0 2 0 10 3 0 0 11 6 1 0 22 36)))
  15.   (setq File_list lst)
  16.   (setq array (vlax-make-safearray 17 (cons 0 (1- (length File_list)))))
  17.   (setq FileGet (vlax-make-variant (vlax-safearray-fill array File_list) 8209))
  18.   (Setq ADO (Vlax-Get-Or-Create-Object "ADODB.Stream" ))
  19.   (Vlax-Put-Property ADO 'Type 1 )
  20.   (Vlax-Invoke ADO 'Open )
  21.   (Vlax-Put-Property ADO 'Position 0 )
  22.   (Vlax-Invoke-Method ADO 'Write FileGet)
  23.   (Vlax-Invoke ADO 'SaveToFile Out 2)
  24.   (Vlax-Invoke-Method ADO 'Close )
  25.   (vlax-release-object ADO)
  26.   (print (load Out))
  27. )

调用方法:
  1. (ggload "nthcdr")
复制代码



为方便讨论,建一个讨论群,后续可以共同讨论函数说明



发一点测试的代码仅供参考:
(get_FileSize "d:\\1.txt")
(get-logical-drives)
(filename-beautify "d:\\1.txt")
(filename-directory "d:\\1.txt")
(filename-non-extension "d:\\1.txt")
(current-date-string)

(current-time-string)
(_lisp-size "123")

(_fullpath "")
(_days-after-96)
(Current-document-lisplet)
(FAS-conf->dword 1 4)
(shell "notepad") 这个代替startapp不弹窗
(setq a "(1 2 3)")

(ads-getsym "a")
(lresb->reslist (reslist->lresb '("1" "2" "3")))
(prv-build (prv-fetch "D:\\Lisp加密\\43797405\\mi\\namespace.prv") ) 用Lisp实现全自动编译VLX
(nthcdr 1 '(1 2))

(list-elt '(1 2) 0)
(reader-whitespace)
(read-word (make-string-input-stream "123"))
(_vl-fast-mode 'tt)
(intern 'tt (init:AUTOLISP-package))
(type-of (Current-document-lisplet))  用来识别各类内部类型
(xsubr-offs (closure-procedure _load-lisplet-vlx))
(_streambuf-string (_istream-buf *standard-input*))

(_streambuf-string (_ostream-buf *standard-output*))
(yes-or-no-p "发现新版本是否升级?") 需要加载vlide的arx文件
(ACAD)
(COS 4)
(car& '(1))
(_lisp-size "12")
(eqcar '(1) 1) 下面是一些表处理
(rplacd '(6 6 6 ) '(2 3 4 5 6))
(rplaca '(6 6) '(2 3 4 5 6))
(wcons 1 '(2))
(ncons '(1))
(xcons '(1) 2)
(acons 1 '(2) '(3))
(setcar  (list 2 3) '(2))
(setcdr (list 2 3) '(2) )

(revappend '(1 2 3) '(4 5 6))
(lisplet-reference->string (lisplet-reference (Current-document-lisplet)))
(_symbol-lso-list)
(string-by-char-to-list "1,2,3" (ascii ","))  字符串拆分
(_streambuf-string (_istream-buf *standard-input*))  获取命令行内容

另外把电脑时间改到2035年以后,打开CAD,系统时间会被修改,都是在测试内部函数时发现的有趣事情。

其他:
内部函数的发现源自于反编译(编译Fas后,CAD会把部分代码转为内部函数调用)。
内部函数转换为用户函数的发现者是baitang36,他称为隐藏函数。我叫内部函数,因为这是桌子的“内库”。
用Lisp操作内存、汇编玩的较早是晨语。

希望以后有更多人发现好用的函数。
应该还有更多函数,后续慢慢挖。




本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

评分

参与人数 21明经币 +28 金钱 +190 收起 理由
eii + 1 才华侧漏,桌子颤抖!
spp_wall + 1 很给力!
muwind + 1 神马都是浮云
nsh935 + 5
bloodtempt + 1 + 5 很给力!
tryhi + 1 赞一个!
飞诗(fsxm) + 3 + 30 赞一个!
仲文玉 + 3 + 30 神马都是浮云
tigcat + 1 很给力!
yanhongguang202 + 20 很给力!

查看全部评分

"觉得好,就打赏"
还没有人打赏,支持一下

本帖被以下淘专辑推荐:

 楼主| 发表于 2022-8-15 16:45 | 显示全部楼层
本帖最后由 不死猫 于 2022-9-16 10:23 编辑

删除表中第几个元素
(setq lst '(1 2 3 4 5 6))
(list-elt<- lst "$$" 3)
(vl-remove "$$" lst)


有坑的函数:
例如nconc(由concatenate而来)是一个破坏性版本的append。
(setq a '(1 2 3))
(setq a (nconc a a))
会陷入自我循环卡死
发表于 2022-8-16 11:38 | 显示全部楼层
common-lisp中所有操作符和变量共978个

  1. -
  2. &allow-other-keys
  3. &aux
  4. &bodya
  5. &environment
  6. &key
  7. &optional
  8. &rest
  9. &whole
  10. *
  11. **
  12. ***
  13. *break-on-signals*
  14. *compile-file-pathname*
  15. *compile-file-truename*
  16. *compile-print*
  17. *compile-verbose*
  18. *debugger-hook*
  19. *debug-io*
  20. *default-pathname-defaults*
  21. *error-output*
  22. *features*
  23. *gensym-counter*
  24. *load-pathname*
  25. *load-print*
  26. *load-truename*
  27. *load-verbose*
  28. *macroexpand-hook*
  29. *modules*
  30. *package*
  31. *print-array*
  32. *print-base*
  33. *print-case*
  34. *print-circle*
  35. *print-escape*
  36. *print-gensym*
  37. *print-length*
  38. *print-level*
  39. *print-lines*
  40. *print-miser-width*
  41. *print-pprint-dispatch*
  42. *print-pretty*
  43. *print-radix*
  44. *print-readably*
  45. *print-right-margin*
  46. *query-io*
  47. *random-state*
  48. *read-base*
  49. *read-default-float-format*
  50. *read-eval*
  51. *read-suppress*
  52. *readtable*
  53. *standard-input*
  54. *standard-output*
  55. *terminal-io*
  56. *trace-output*
  57. /
  58. //
  59. ///
  60. /=
  61. +
  62. ++
  63. +++
  64. <
  65. <=
  66. =
  67. >
  68. >=
  69. 1-
  70. 1+
  71. abort
  72. abs
  73. acons
  74. acos
  75. acosh
  76. add-method
  77. adjoin
  78. adjustable-array-p
  79. adjust-array
  80. allocate-instance
  81. alpha-char-p
  82. alphanumericp
  83. and
  84. append
  85. apply
  86. apropos
  87. apropos-list
  88. aref
  89. arithmetic-error
  90. arithmetic-error-operands
  91. arithmetic-error-operation
  92. array
  93. array-dimension
  94. array-dimension-limit
  95. array-dimensions
  96. array-displacement
  97. array-element-type
  98. array-has-fill-pointer-p
  99. array-in-bounds-p
  100. arrayp
  101. array-rank
  102. array-rank-limit
  103. array-row-major-index
  104. array-total-size
  105. array-total-size-limit
  106. ash
  107. asin
  108. asinh
  109. assert
  110. assoc
  111. assoc-if
  112. assoc-if-not
  113. atan
  114. atanh
  115. atom
  116. base-char
  117. base-string
  118. bignum
  119. bit
  120. bit-and
  121. bit-andc1
  122. bit-andc2
  123. bit-eqv
  124. bit-ior
  125. bit-nand
  126. bit-nor
  127. bit-not
  128. bit-orc1
  129. bit-orc2
  130. bit-vector
  131. bit-vector-p
  132. bit-xor
  133. block
  134. boole
  135. boole-1
  136. boole-2
  137. boolean
  138. boole-and
  139. boole-andc1
  140. boole-andc2
  141. boole-c1
  142. boole-c2
  143. boole-clr
  144. boole-eqv
  145. boole-ior
  146. boole-nand
  147. boole-nor
  148. boole-orc1
  149. boole-orc2
  150. boole-set
  151. boole-xor
  152. both-case-p
  153. boundp
  154. break
  155. broadcast-stream
  156. broadcast-stream-streams
  157. built-in-class
  158. butlast
  159. byte
  160. byte-position
  161. byte-size
  162. caaaar
  163. caaadr
  164. caaar
  165. caadar
  166. caaddr
  167. caadr
  168. caar
  169. cadaar
  170. cadadr
  171. cadar
  172. caddar
  173. cadddr
  174. caddr
  175. cadr
  176. call-arguments-limit
  177. call-method
  178. call-next-method
  179. car
  180. case
  181. catch
  182. ccase
  183. cdaaar
  184. cdaadr
  185. cdaar
  186. cdadar
  187. cdaddr
  188. cdadr
  189. cdar
  190. cddaar
  191. cddadr
  192. cddar
  193. cdddar
  194. cddddr
  195. cdddr
  196. cddr
  197. cdr
  198. ceiling
  199. cell-error
  200. cell-error-name
  201. cerror
  202. change-class
  203. char
  204. char/=
  205. char<
  206. char<=
  207. char=
  208. char>
  209. char>=
  210. character
  211. characterp
  212. char-code
  213. char-code-limit
  214. char-downcase
  215. char-equal
  216. char-greaterp
  217. char-int
  218. char-lessp
  219. char-name
  220. char-not-equal
  221. char-not-greaterp
  222. char-not-lessp
  223. char-upcase
  224. check-type
  225. cis
  226. class
  227. class-name
  228. class-of
  229. clear-input
  230. clear-output
  231. close
  232. clrhash
  233. code-char
  234. coerce
  235. compilation-speed
  236. compile
  237. compiled-function
  238. compiled-function-p
  239. compile-file
  240. compile-file-pathname
  241. compiler-macro
  242. compiler-macro-function
  243. complement
  244. complex
  245. complexp
  246. compute-applicable-methods
  247. compute-restarts
  248. concatenate
  249. concatenated-stream
  250. concatenated-stream-streams
  251. cond
  252. condition
  253. conjugate
  254. cons
  255. consp
  256. constantly
  257. constantp
  258. continue
  259. control-error
  260. copy-alist
  261. copy-list
  262. copy-pprint-dispatch
  263. copy-readtable
  264. copy-seq
  265. copy-structure
  266. copy-symbol
  267. copy-tree
  268. cos
  269. cosh
  270. count
  271. count-if
  272. count-if-not
  273. ctypecase
  274. debug
  275. decf
  276. declaim
  277. declaration
  278. declare
  279. decode-float
  280. decode-universal-time
  281. defclass
  282. defconstant
  283. defgeneric
  284. define-compiler-macro
  285. define-condition
  286. define-method-combination
  287. define-modify-macro
  288. define-setf-expander
  289. define-symbol-macro
  290. defmacro
  291. defmethod
  292. defpackage
  293. defparameter
  294. defsetf
  295. defstruct
  296. deftype
  297. defun
  298. defvar
  299. delete
  300. delete-duplicates
  301. delete-file
  302. delete-if
  303. delete-if-not
  304. delete-package
  305. denominator
  306. deposit-field
  307. describe
  308. describe-object
  309. destructuring-bind
  310. digit-char
  311. digit-char-p
  312. directory
  313. directory-namestring
  314. disassemble
  315. division-by-zero
  316. do
  317. do*
  318. do-all-symbols
  319. documentation
  320. do-external-symbols
  321. dolist
  322. do-symbols
  323. dotimes
  324. double-float
  325. double-float-epsilon
  326. double-float-negative-epsilon
  327. dpb
  328. dribble
  329. dynamic-extent
  330. ecase
  331. echo-stream
  332. echo-stream-input-stream
  333. echo-stream-output-stream
  334. ed
  335. eighth
  336. elt
  337. encode-universal-time
  338. end-of-file
  339. endp
  340. enough-namestring
  341. ensure-directories-exist
  342. ensure-generic-function
  343. eq
  344. eql
  345. equal
  346. equalp
  347. error
  348. etypecase
  349. eval
  350. eval-when
  351. evenp
  352. every
  353. exp
  354. export
  355. expt
  356. extended-char
  357. fboundp
  358. fceiling
  359. fdefinition
  360. ffloor
  361. fifth
  362. file-author
  363. file-error
  364. file-error-pathname
  365. file-length
  366. file-namestring
  367. file-position
  368. file-stream
  369. file-string-length
  370. file-write-date
  371. fill
  372. fill-pointer
  373. find
  374. find-all-symbols
  375. find-class
  376. find-if
  377. find-if-not
  378. find-method
  379. find-package
  380. find-restart
  381. find-symbol
  382. finish-output
  383. first
  384. fixnum
  385. flet
  386. float
  387. float-digits
  388. floating-point-inexact
  389. floating-point-invalid-operation
  390. floating-point-overflow
  391. floating-point-underflow
  392. floatp
  393. float-precision
  394. float-radix
  395. float-sign
  396. floor
  397. fmakunbound
  398. force-output
  399. format
  400. formatter
  401. fourth
  402. fresh-line
  403. fround
  404. ftruncate
  405. ftype
  406. funcall
  407. function
  408. function-keywords
  409. function-lambda-expression
  410. functionp
  411. gcd
  412. generic-function
  413. gensym
  414. gentemp
  415. get
  416. get-decoded-time
  417. get-dispatch-macro-character
  418. getf
  419. gethash
  420. get-internal-real-time
  421. get-internal-run-time
  422. get-macro-character
  423. get-output-stream-string
  424. get-properties
  425. get-setf-expansion
  426. get-universal-time
  427. go
  428. graphic-char-p
  429. handler-bind
  430. handler-case
  431. hash-table
  432. hash-table-count
  433. hash-table-p
  434. hash-table-rehash-size
  435. hash-table-rehash-threshold
  436. hash-table-size
  437. hash-table-test
  438. host-namestring
  439. identity
  440. if
  441. ignorable
  442. ignore
  443. ignore-errors
  444. imagpart
  445. import
  446. incf
  447. initialize-instance
  448. inline
  449. in-package
  450. input-stream-p
  451. inspect
  452. integer
  453. integer-decode-float
  454. integer-length
  455. integerp
  456. interactive-stream-p
  457. intern
  458. internal-time-units-per-second
  459. intersection
  460. invalid-method-error
  461. invoke-debugger
  462. invoke-restart
  463. invoke-restart-interactively
  464. isqrt
  465. keyword
  466. keywordp
  467. labels
  468. lambda
  469. lambda-list-keywords
  470. lambda-parameters-limit
  471. last
  472. lcm
  473. ldb
  474. ldb-test
  475. ldiff
  476. least-negative-double-float
  477. least-negative-long-float
  478. least-negative-normalized-double-float
  479. least-negative-normalized-long-float
  480. least-negative-normalized-short-float
  481. least-negative-normalized-single-float
  482. least-negative-short-float
  483. least-negative-single-float
  484. least-positive-double-float
  485. least-positive-long-float
  486. least-positive-normalized-double-float
  487. least-positive-normalized-long-float
  488. least-positive-normalized-short-float
  489. least-positive-normalized-single-float
  490. least-positive-short-float
  491. least-positive-single-float
  492. length
  493. let
  494. let*
  495. lisp-implementation-type
  496. lisp-implementation-version
  497. list
  498. list*
  499. list-all-packages
  500. listen
  501. list-length
  502. listp
  503. load
  504. load-logical-pathname-translations
  505. load-time-value
  506. locally
  507. log
  508. logand
  509. logandc1
  510. logandc2
  511. logbitp
  512. logcount
  513. logeqv
  514. logical-pathname
  515. logical-pathname-translations
  516. logior
  517. lognand
  518. lognor
  519. lognot
  520. logorc1
  521. logorc2
  522. logtest
  523. logxor
  524. long-float
  525. long-float-epsilon
  526. long-float-negative-epsilon
  527. long-site-name
  528. loop
  529. loop-finish
  530. lower-case-p
  531. machine-instance
  532. machine-type
  533. machine-version
  534. macroexpand
  535. macroexpand-1
  536. macro-function
  537. macrolet
  538. make-array
  539. make-broadcast-stream
  540. make-concatenated-stream
  541. make-condition
  542. make-dispatch-macro-character
  543. make-echo-stream
  544. make-hash-table
  545. make-instance
  546. make-instances-obsolete
  547. make-list
  548. make-load-form
  549. make-load-form-saving-slots
  550. make-method
  551. make-package
  552. make-pathname
  553. make-random-state
  554. make-sequence
  555. make-string
  556. make-string-input-stream
  557. make-string-output-stream
  558. make-symbol
  559. make-synonym-stream
  560. make-two-way-stream
  561. makunbound
  562. map
  563. mapc
  564. mapcan
  565. mapcar
  566. mapcon
  567. maphash
  568. map-into
  569. mapl
  570. maplist
  571. mask-field
  572. max
  573. member
  574. member-if
  575. member-if-not
  576. merge
  577. merge-pathnames
  578. method
  579. method-combination
  580. method-combination-error
  581. method-qualifiers
  582. min
  583. minusp
  584. mismatch
  585. mod
  586. most-negative-double-float
  587. most-negative-fixnum
  588. most-negative-long-float
  589. most-negative-short-float
  590. most-negative-single-float
  591. most-positive-double-float
  592. most-positive-fixnum
  593. most-positive-long-float
  594. most-positive-short-float
  595. most-positive-single-float
  596. muffle-warning
  597. multiple-value-bind
  598. multiple-value-call
  599. multiple-value-list
  600. multiple-value-prog1
  601. multiple-value-setq
  602. multiple-values-limit
  603. name-char
  604. namestring
  605. nbutlast
  606. nconc
  607. next-method-p
  608. nil
  609. nintersection
  610. ninth
  611. no-applicable-method
  612. no-next-method
  613. not
  614. notany
  615. notevery
  616. notinline
  617. nreconc
  618. nreverse
  619. nset-difference
  620. nset-exclusive-or
  621. nstring-capitalize
  622. nstring-downcase
  623. nstring-upcase
  624. nsublis
  625. nsubst
  626. nsubst-if
  627. nsubst-if-not
  628. nsubstitute
  629. nsubstitute-if
  630. nsubstitute-if-not
  631. nth
  632. nthcdr
  633. nth-value
  634. null
  635. number
  636. numberp
  637. numerator
  638. nunion
  639. oddp
  640. open
  641. open-stream-p
  642. optimize
  643. or
  644. otherwise
  645. output-stream-p
  646. package
  647. package-error
  648. package-error-package
  649. package-name
  650. package-nicknames
  651. packagep
  652. package-shadowing-symbols
  653. package-used-by-list
  654. package-use-list
  655. pairlis
  656. parse-error
  657. parse-integer
  658. parse-namestring
  659. pathname
  660. pathname-device
  661. pathname-directory
  662. pathname-host
  663. pathname-match-p
  664. pathname-name
  665. pathnamep
  666. pathname-type
  667. pathname-version
  668. peek-char
  669. phase
  670. pi
  671. plusp
  672. pop
  673. position
  674. position-if
  675. position-if-not
  676. pprint
  677. pprint-dispatch
  678. pprint-exit-if-list-exhausted
  679. pprint-fill
  680. pprint-indent
  681. pprint-linear
  682. pprint-logical-block
  683. pprint-newline
  684. pprint-pop
  685. pprint-tab
  686. pprint-tabular
  687. prin1
  688. prin1-to-string
  689. princ
  690. princ-to-string
  691. print
  692. print-not-readable
  693. print-not-readable-object
  694. print-object
  695. print-unreadable-object
  696. probe-file
  697. proclaim
  698. prog
  699. prog*
  700. prog1
  701. prog2
  702. progn
  703. program-error
  704. progv
  705. provide
  706. psetf
  707. psetq
  708. push
  709. pushnew
  710. quote
  711. random
  712. random-state
  713. random-state-p
  714. rassoc
  715. rassoc-if
  716. rassoc-if-not
  717. ratio
  718. rational
  719. rationalize
  720. rationalp
  721. read
  722. read-byte
  723. read-char
  724. read-char-no-hang
  725. read-delimited-list
  726. reader-error
  727. read-from-string
  728. read-line
  729. read-preserving-whitespace
  730. read-sequence
  731. readtable
  732. readtable-case
  733. readtablep
  734. real
  735. realp
  736. realpart
  737. reduce
  738. reinitialize-instance
  739. rem
  740. remf
  741. remhash
  742. remove
  743. remove-duplicates
  744. remove-if
  745. remove-if-not
  746. remove-method
  747. remprop
  748. rename-file
  749. rename-package
  750. replace
  751. require
  752. rest
  753. restart
  754. restart-bind
  755. restart-case
  756. restart-name
  757. return
  758. return-from
  759. revappend
  760. reverse
  761. room
  762. rotatef
  763. round
  764. row-major-aref
  765. rplaca
  766. rplacd
  767. safety
  768. satisfies
  769. sbit
  770. scale-float
  771. schar
  772. search
  773. second
  774. sequence
  775. serious-condition
  776. set
  777. set-difference
  778. set-dispatch-macro-character
  779. set-exclusive-or
  780. setf
  781. set-macro-character
  782. set-pprint-dispatch
  783. setq
  784. set-syntax-from-char
  785. seventh
  786. shadow
  787. shadowing-import
  788. shared-initialize
  789. shiftf
  790. short-float
  791. short-float-epsilon
  792. short-float-negative-epsilon
  793. short-site-name
  794. signal
  795. signed-byte
  796. signum
  797. simple-array
  798. simple-base-string
  799. simple-bit-vector
  800. simple-bit-vector-p
  801. simple-condition
  802. simple-condition-format-arguments
  803. simple-condition-format-control
  804. simple-error
  805. simple-string
  806. simple-string-p
  807. simple-type-error
  808. simple-vector
  809. simple-vector-p
  810. simple-warning
  811. sin
  812. single-float
  813. single-float-epsilon
  814. single-float-negative-epsilon
  815. sinh
  816. sixth
  817. sleep
  818. slot-boundp
  819. slot-exists-p
  820. slot-makunbound
  821. slot-missing
  822. slot-unbound
  823. slot-value
  824. software-type
  825. software-version
  826. some
  827. sort
  828. space
  829. special
  830. special-operator-p
  831. speed
  832. sqrt
  833. stable-sort
  834. standard
  835. standard-char
  836. standard-char-p
  837. standard-class
  838. standard-generic-function
  839. standard-method
  840. standard-object
  841. step
  842. storage-condition
  843. store-value
  844. stream
  845. stream-element-type
  846. stream-error
  847. stream-error-stream
  848. stream-external-format
  849. streamp
  850. string
  851. string/=
  852. string<
  853. string<=
  854. string=
  855. string>
  856. string>=
  857. string-capitalize
  858. string-downcase
  859. string-equal
  860. string-greaterp
  861. string-left-trim
  862. string-lessp
  863. string-not-equal
  864. string-not-greaterp
  865. string-not-lessp
  866. stringp
  867. string-right-trim
  868. string-stream
  869. string-trim
  870. string-upcase
  871. structure
  872. structure-class
  873. structure-object
  874. style-warning
  875. sublis
  876. subseq
  877. subsetp
  878. subst
  879. subst-if
  880. subst-if-not
  881. substitute
  882. substitute-if
  883. substitute-if-not
  884. subtypep
  885. svref
  886. sxhash
  887. symbol
  888. symbol-function
  889. symbol-macrolet
  890. symbol-name
  891. symbolp
  892. symbol-package
  893. symbol-plist
  894. symbol-value
  895. synonym-stream
  896. synonym-stream-symbol
  897. t
  898. tagbody
  899. tailp
  900. tan
  901. tanh
  902. tenth
  903. terpri
  904. the
  905. third
  906. throw
  907. time
  908. trace
  909. translate-logical-pathname
  910. translate-pathname
  911. tree-equal
  912. truename
  913. truncate
  914. two-way-stream
  915. two-way-stream-input-stream
  916. two-way-stream-output-stream
  917. type
  918. typecase
  919. type-error
  920. type-error-datum
  921. type-error-expected-type
  922. type-of
  923. typep
  924. unbound-slot
  925. unbound-slot-instance
  926. unbound-variable
  927. undefined-function
  928. unexport
  929. unintern
  930. union
  931. unless
  932. unread-char
  933. unsigned-byte
  934. untrace
  935. unuse-package
  936. unwind-protect
  937. update-instance-for-different-class
  938. update-instance-for-redefined-class
  939. upgraded-array-element-type
  940. upgraded-complex-part-type
  941. upper-case-p
  942. use-package
  943. user-homedir-pathname
  944. use-value
  945. values
  946. values-list
  947. variable
  948. vector
  949. vectorp
  950. vector-pop
  951. vector-push
  952. vector-push-extend
  953. warn
  954. warning
  955. when
  956. wild-pathname-p
  957. with-accessors
  958. with-compilation-unit
  959. with-condition-restarts
  960. with-hash-table-iterator
  961. with-input-from-string
  962. with-open-file
  963. with-open-stream
  964. with-output-to-string
  965. with-package-iterator
  966. with-simple-restart
  967. with-slots
  968. with-standard-io-syntax
  969. write
  970. write-byte
  971. write-char
  972. write-line
  973. write-sequence
  974. write-string
  975. write-to-string
  976. yes-or-no-p
  977. y-or-n-p
  978. zerop

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

评分

参与人数 1明经币 +1 收起 理由
自贡黄明儒 + 1 赞一个!

查看全部评分

发表于 2022-8-15 19:18 | 显示全部楼层
冒号 : 开头的符号是自解析符号的一种,一般指 关键字keyword 符号.
autolisp 为了易用性,封印了很多 lisp 高级特性。
回复 支持 1 反对 0

使用道具 举报

发表于 2022-8-15 14:38 | 显示全部楼层
本帖最后由 自贡黄明儒 于 2022-9-17 13:55 编辑

谢谢猫老师,感谢分享。


;;[功能]去掉之字符串小数点后字符
命令: (tranf 'filename-non-extension)
T
命令: (filename-non-extension "D:\\1.txt")
"D:\\1"
命令: (filename-non-extension "D:\\1.txt.txt")
"D:\\1.txt"

;;[功能]文件名分成三部分
(tranf 'as:fnsplitl)
(as:fnsplitl "D:\\0000\\1.txt");==>("D:\\0000\\" "1" ".txt")
(fnsplitl "D:\\0000\\1.txt.txt");==>("D:\\0000\\" "1.txt" ".txt")
;;参考as:fnsplitl

;;[功能]lisp编辑器无法再编辑??
(tranf 'sys-top);==>T
(sys-top)

;;[功能]盘符序列号
(tranf 'FIND_SERIALNUMBER);;==>T
(FIND_SERIALNUMBER "c:")
(FIND_SERIALNUMBER "D:\\")

;get-logical-drives
;;[功能]盘符
(tranf "get-logical-drives")
(get-logical-drives)


(tranf "_read-nb")
(tranf "_write-nb-str")
;;;(setq fname (findfile "D:\\0000\\1.lsp"))
;;;(setq f (open fname "r"))
;;;(setq str (_read-nb 64000000 f))      
;;;(close f)

;;[功能]文件大小(多少字节),同vl-file-size
(tranf "file-size")
(file-size "D:\\0000\\1.txt")

(tranf "file-mod-time")
(tranf "file-read-only-p")
(tranf "file-readable-p")
(file-mod-time "D:\\0000\\1.txt");不知这个时间怎么搞
(file-read-only-p "D:\\0000\\1.txt");只读为T
(file-readable-p "D:\\0000\\1.txt");可读

(tranf "member-if")
(tranf "member-if-not")
(member-if 'numberp '("a" 1 "a" 1))
(member-if 'numberp '("a" "a" 1 "a" 1));==>(1 "a" 1)

(tranf "merge")
(merge '(1 2) '(4 5) +);==>(4 5 1 2)
(merge '((1) 2) '((3)(3)) 'append);==>((3) (3) (1) 2)

;;(if (member item list) list (cons item list))
(tranf "adjoin")
(adjoin 2 '(3 5));==>(2 3 5)
(adjoin 2 '(3 5 2));==>(3 5 2)

;;不好用,只能三个参数,最后一个须是表
(tranf "acons")
(acons 1 2 '(3));==>((1 . 2) 3)

(tranf "butlast")
(butlast '(1 2 3 4));==>(1 2 3)

;;类似VBS中的写法了
(tranf "funcall")
(funcall '+ 1 2 3)
(funcall + 1 2 3);==>6

(tranf "reduce")
(reduce '+ '(1 2 3) 4);==>10

(tranf "make-list")
(make-list 5 4);==>(4 4 4 4 4)
(make-list 5);==>(nil nil nil nil nil)

;;相当于append
(tranf "nconc")
(nconc '(1 2) '(2) 3);==>(1 2 2 . 3)前面必须是表
(nconc '(1 2) '(2) '(3 4));>>(1 2 2 3 4)
(nconc '(1 2) '(1 2));(1 2 1 2)

;;只能两个参数表;前面一个表倒置了
(tranf "nreconc")
(nreconc '(1 2) '(3 4));==>(2 1 3 4)
(nreconc '(1 2) 3);==>(2 1 . 3)

;;只能是点对中搜索,按后一个元素搜索
(tranf "rassoc")
(rassoc 'a '((a . b) (b . c) (c . a) (z . a)));==>(C . A)按后一个元素搜索
(rassoc 3 '((1 . 2) (3 . 2) (4 . 3) (5 . 3)));(4 . 3)
(assoc 3 '((1 2) (3 2) (4 3) (5 3)));==>(3 2)这个可以是表

;;换第一个元素
(tranf "rplaca")
(rplaca '(1 2 3 4) 5);==>(5 2 3 4)

;;(cons (car x) lst)
(tranf "rplacd")
(rplacd '(3 2 3 4) 5);==>(3 . 5)取第一个元素组成点对
(rplacd '(3 2 3 4) '(5 0 1));(3 5 0 1)

(tranf "string->list")
(string->list "A自");(65 215 212)同(VL-STRING->LIST "A自") "12自贡3"

(tranf "string-append")
(string-append "A自" "3" "3");"A自33",相当于strcat

(tranf "string-by-char-to-list")
(string-by-char-to-list "AAb3b3自" (ascii "b"));("AA" "3" "3自")
;;不支持中文
(string-by-char-to-list "AAb自3b自3自" (ascii "自"));("AAb" "?b" "?" "

;;首字母大写
(tranf "string-capitalize")
(string-capitalize "hello,world");"Hello,World"
(string-capitalize "hello,world")

;;大写(不如strcase好用)
(tranf "string-upcase")
(string-upcase "hello,world自");"HELLO,WORLD自"
(strcase "hEllo,world自" t);"hello,world自"

;;计数
(tranf "string-count")
(string-count (ascii "b") "自ababc");2 "b"的数量

(tranf "string-downcase")
(string-downcase "Hello,World");"hello,world"

;;(VL-STRING->LIST "Hello,World");(72 101 108 108 111 44 87 111 114 108 100)
(tranf "string-elt");字符串中的位移。第一个字符的位移为 0
(string-elt "Hello,World" 2);108

(tranf "string-elt<-")
(setq a "hello")
(string-elt<- a 65 2);此时a 变成了"heAlo"

;;猜不出
(tranf "string-expand-clip")
(string-expand-clip "Hello,World")

;;是否有前缀
(tranf "string-has-prefix-p")
(string-has-prefix-p "hello" "he");T 区分大小写

(tranf "string-left-trim")
(string-left-trim "he" "hello");"llo" 同VL-STRING-LEFT-TRIM

;;字符串长度
(tranf "string-length")
(string-length "hello");5
(string-length "hello自");7 看来中文还是按2个长度计算的。
(strlength "hello自")

;;不好猜
(tranf "string<")
(string< "Atxt" "bbb");t
(string< "aaaaaaa" "bb" "bbb");t

;;是否字符串
(tranf "stringp")
(stringp "2Atxt");t
(stringp 2);nil
(stringp (car(entsel)));nil

;;字符串是否相同
(tranf "string=")
(string= "2Atxt" "2Atxt" "2Atxt");t
(string= "ABC" "abc");nil 区分大小写

;;[功能]只能比较字符串,不区分大小写
(tranf "string-equal")
(string-equal ".Fas" ".fas" ".fAs");===>T
(string-equal ".fas" "a.Fas");===>nil

;;前后剪切
(tranf "string-trim")
(string-trim  " .F" " .Fa sF ");" .Fas " 同VL-STRING-TRIM
(VL-STRING-TRIM  " .F" " .Fa sF ")
(tranf "string-right-trim")

;;字符串填充
(tranf "string-fill")
(setq a "abc")
(string-fill a 65);!a==>"AAA"
;;(chr 65)==>"A"

;;string-key-value
;;string-lessp
;;string-mismatch
;;string-position
;;string-psubst
;;string-resource
;;string-search
;;string-subseq
;;string-subst
;;string-translate



发表于 2022-8-15 13:16 来自手机 | 显示全部楼层
啊这,我是第一,下载来学习学习
发表于 2022-8-15 13:17 | 显示全部楼层
谢谢猫老师,感谢分享。
发表于 2022-8-15 13:18 | 显示全部楼层

谢谢猫老师,感谢分享。
发表于 2022-8-15 13:19 | 显示全部楼层
强            
发表于 2022-8-15 13:21 来自手机 | 显示全部楼层
6666666666
发表于 2022-8-15 13:22 来自手机 | 显示全部楼层
猫老师太强了,谢谢分享
发表于 2022-8-15 13:22 | 显示全部楼层
给力,来看看是什么东东
发表于 2022-8-15 13:24 | 显示全部楼层
感谢猫老师,谢谢分享
发表于 2022-8-15 13:25 | 显示全部楼层
:D感谢猫老师
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-23 14:41 , Processed in 0.417496 second(s), 33 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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