Michael Blume (dudley_doright) の書き込み:
Michael Blume
dudley_doright

Macro help

So I'm finding myself writing macros that look like this
(defmacro set-from-map [objform valmapform & set-pairs]
  (let [obj (gensym)
        valmap (gensym)]
    `(let [~obj    ~objform
           ~valmap ~valmapform]
       (other stuff happens here))))
Those top two lets are basically just letting me make obj and valmap strict -- making them evaluate immediately instead of *pasting their code* wherever my macro might use them. I'm seeing this pattern a lot, and of course, Patterns Are Evil. Can anyone see an easy way to eradicate it?
  • コメントを送信する

    エラー

    デフォルトのユーザーアイコン

    この返信は非公開になります

    あなたのIPアドレスは記録されます 

  • 2 件のコメント