Julia 中文文档. . . . . . . . . . . 1149 92.2 Julia 的 AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1149 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . 工作方式类似于 eval(:x),其返回 x 的值,而 两个 $ 行为相当于 eval(eval(:x))。 194 CHAPTER 19. 元编程 QuoteNode quote 形式在 AST 中通常表示为一个 head 为 :quote 的 Expr : julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: with 2 methods) julia> @m "asd" 1 arguments julia> @m 1 2 Two arguments 但是应该记住,宏派发基于传递给宏的 AST 的类型,而不是 AST 在运行时进行求值的类型: julia> macro m(::Int) println("An Integer") end 19.4. 代码生成 203 @m (macro with0 码力 | 1238 页 | 4.59 MB | 1 年前3
Julia v1.2.0 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1155 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1156 Lowered eval(eval(:x)). 218 CHAPTER 25. METAPROGRAMMING QuoteNode The usual representa�on of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at run�me: julia> macro m(::Int) println("An Integer")0 码力 | 1250 页 | 4.29 MB | 1 年前3
Julia 1.2.0 DEV Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1157 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1158 Lowered eval(eval(:x)). 220 CHAPTER 26. METAPROGRAMMING QuoteNode The usual representa�on of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at run�me: julia> macro m(::Int) println("An Integer")0 码力 | 1252 页 | 4.28 MB | 1 年前3
Julia v1.1.1 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1122 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1127 101.3More eval(eval(:x)). 218 CHAPTER 25. METAPROGRAMMING QuoteNode The usual representa�on of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at run�me: julia> macro m(::Int) println("An Integer")0 码力 | 1216 页 | 4.21 MB | 1 年前3
Julia 1.1.0 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1120 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1125 101.3More eval(eval(:x)). 218 CHAPTER 25. METAPROGRAMMING QuoteNode The usual representa�on of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at run�me: julia> macro m(::Int) println("An Integer")0 码力 | 1214 页 | 4.21 MB | 1 年前3
Julia v1.4.2 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1215 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1216 Lowered form $s do the equivalent of eval(eval(:x)). QuoteNode The usual representation of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime: julia> macro m(::Int) println("An Integer")0 码力 | 1314 页 | 4.29 MB | 1 年前3
Julia v1.5.4 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1213 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214 Lowered form $s do the equivalent of eval(eval(:x)). QuoteNode The usual representation of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime: julia> macro m(::Int) println("An Integer")0 码力 | 1337 页 | 4.41 MB | 1 年前3
Julia 1.5.3 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1211 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1212 Lowered form $s do the equivalent of eval(eval(:x)). QuoteNode The usual representation of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime: julia> macro m(::Int) println("An Integer")0 码力 | 1335 页 | 4.41 MB | 1 年前3
Julia 1.4.1 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1213 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1214 Lowered form $s do the equivalent of eval(eval(:x)). QuoteNode The usual representation of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime: julia> macro m(::Int) println("An Integer")0 码力 | 1312 页 | 4.29 MB | 1 年前3
Julia 1.4.0 Documentation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1241 Surface syntax AST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1242 Lowered form $s do the equivalent of eval(eval(:x)). QuoteNode The usual representation of a quote form in an AST is an Expr with head :quote: julia> dump(Meta.parse(":(1+2)")) Expr head: Symbol quote args: Array{Any}((1 one should keep in mind, that macro dispatch is based on the types of AST that are handed to the macro, not the types that the AST evaluates to at runtime: julia> macro m(::Int) println("An Integer")0 码力 | 1340 页 | 4.36 MB | 1 年前3
共 87 条
- 1
- 2
- 3
- 4
- 5
- 6
- 9













