乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 24|回复: 1

[编程交流] What's With QUOTE in the

[复制链接]

180

主题

639

帖子

463

银币

中流砥柱

Rank: 25

铜币
897
发表于 2022-7-5 17:33:50 | 显示全部楼层 |阅读模式
Some other developers here are sending some variables with values into the project I'm working on from C#.NET code. It looks simple but something I did not expect is happening.
 
  1. (setq the_array '('(1 "R" 0 1) '(1 "L" 0 1) '(0 "L" 0 1) '(0 "R" 0 1) '(1 "R" 1 1) '(1 "L" 1 1)))
If I examine the value of this variable called the_array it will show this:
I wasn't expecting the word "QUOTE" to show up in the array. I'm going to parse this text to do some drawing tasks so just deleting this text from the string I think I can handle. I'd like to know why it shows up in the first place. I think this guy's attempt to form a list of lists is not quite right. 
By removing the leading apostrophes I able to get the "QUOTE" text out of the value, but I have to admit I wasn't expecting this to happen. Nor were the other developers. And to be honest, I don't really need the " " around the text items in this either. So I'm going to change their input slightly to make it easier to parse this list of lists.
回复

使用道具 举报

114

主题

1万

帖子

1万

银币

中流砥柱

Rank: 25

铜币
543
发表于 2022-7-5 18:44:15 | 显示全部楼层
The apostrophe or single quote is a shorthand equivalent for the AutoLISP quote function, therefore, by quoting a list which contains single quotes, you will see the AutoLISP quote function appear as the quoted list is a literal expression and hence is not evaluated. This is no different to quoting a list containing any other AutoLISP function or symbol. Since the entire list is already quoted as a literal expression, the quotes within the list are redundant - see here for more information.
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-13 06:12 , Processed in 0.411517 second(s), 67 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表