template A(body:untyped) :int = 1
let a = A: discard
echo a
ではいけないんでしょうか
Nim
1template A(body:untyped) :int = 1 2let a = A: discard
こう書くと OK ですが、
Nim
1template A(body:untyped) :int = 1 2echo A: discard
こう書くと echo
に A
と:discard
の2つを渡してる事になってコンパイルエラーになります。
echo
に A :discard
を渡す方法はありますか?
あなたの回答
tips
プレビュー