Arc Forumnew | comments | leaders | submitlogin
Dumb question
6 points by projectileboy 5923 days ago | 5 comments
Since quote and backquote give the same behavior when we haven't plugged in any comma or comma-at expressions, couldn't we get rid of either the quote or the backquote, and just have one or the other?


3 points by drcode 5923 days ago | link

Two reasons I can think of:

1. Regular quoting is far simpler and has a much lower cognitive load (i.e. there are less things you have to be careful about when you use it)

2. On occasion, you need to quote data that contains commas or comma-ats without expanding anything. For instance, you may want to quote a piece of code to send to eval and that could contain a macro.

Your points do carry some weight, though- However, quotes and backquotes are heavily used in the ugliest of ugly macrology, so having both symbols available makes life significantly easier in those cases IMHO even if the simple quote seems somewhat redundant.

-----

1 point by cchooper 5922 days ago | link

If you don't want the commas to be expanded, you can always add another quasi-quote.

-----

6 points by rincewind 5922 days ago | link

Please choose a more informative title for your question the next time: I suggest "Dumb question about quotation axioms" or "Is quote redundant with quasiquote?"

-----

6 points by rincewind 5922 days ago | link

It would be possible to get rid of quasiquote as an axiom.

You can define it as a macro in terms of cons and quote.

-----

1 point by cchooper 5922 days ago | link

Yes, quote could be eliminated entirely and you could just quasi-quote everything, but it could introduce subtle bugs. For example, any list literal containing the symbol 'unquote could potentially get expanded by mistake.

  (= x "foo")
  `((unquote x))
  => ("foo")
Common Lisp improves the situation slightly by using the internal symbol SYSTEM::UNQUOTE to represent a comma, but that's still not perfect.

-----