What are all the cases of ellipsis in Scheme pattern matching Hygienic Macros System

柔情痞子 提交于 2020-04-30 09:21:22

问题


This is continuation of my previous question Missing argument in syntax-rules Hygienic macro call from Scheme R5RS example

so you can have only this two cases:

  1. First
     (foo bar baz) ...

that can be used as

foo ... ==> (foo_1 _ foo_2 _ foo_3 _)

bar ... ==> (_ bar_1 _ bar_2 _ bar_3 _)

or

(foo bar bar) ...

but what should expand this expression into?

(foo baz) ...
  1. Second
    (foo bar baz ...)

which can be used as baz ... that expands into ,@(1 2 3) if input is (anything 0 1 2 3).

Are there any other cases? Is this documented somewhere? Or do you need to extract this information from R5RS that don't show any examples of all those cases?

来源:https://stackoverflow.com/questions/61202006/what-are-all-the-cases-of-ellipsis-in-scheme-pattern-matching-hygienic-macros-sy

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!