用法
评论
建议
取 消
确 定
(defun dcl:lst2dcl (lst) "将 lst 格式的DCL 描述表达式转为 DCL 格式. lst 格式说明:当为点对时,表示为属性值对,当为列表时,第一个元素为 Tile 名。" "String" "(dcl:lst2dcl '(button (key . btn)(label . BTN)(width . 20)(height . 3)) ;; => :button {key=\"btn\";label=\"BTN\";width=20;height=3;}" (defun handle-value (sym) (cond ((p:intp sym) (itoa sym)) ((numberp sym) (rtos sym 2 3)) ((p:stringp sym) (strcat "\"" sym "\"")) ((member sym (quote (true false))) (vl-symbol-name sym)) (t (strcat "\"" (vl-symbol-name sym) "\"")))) (if (p:stringp lst) lst (cond ((null lst) "") ((p:dotpairp lst) (strcat (vl-symbol-name (car lst)) "=" (handle-value (cdr lst)) ";")) ((listp lst) (cond ((atom (car lst)) (strcat ":" (vl-string-trim ":" (vl-symbol-name (car lst))) "{" (dcl:lst2dcl (cdr lst)) "}")) (t (string:from-lst (mapcar (quote dcl:lst2dcl) lst) "")))))))
函数库使用说明
应用包
技术支持
统计信息
函数库规模: 725 个
函数库类别: 50 种
上传记录
刷新