Skip to content

Commit fd517a2

Browse files
authored
Merge pull request #82 from matbesancon/patch-1
Update README.md
2 parents f6a4fa9 + 88414ca commit fd517a2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ have a type definition:
1313

1414
```julia
1515
ex = quote
16-
type Foo
16+
struct Foo
1717
x::Int
1818
y
1919
end
@@ -23,7 +23,7 @@ end
2323
If you know what you're doing, you can pull out the name and fields via:
2424

2525
```julia
26-
julia> if isexpr(ex.args[2], :type)
26+
julia> if isexpr(ex.args[2], :struct)
2727
(ex.args[2].args[2], ex.args[2].args[3].args)
2828
end
2929
(:Foo,{:( # line 3:),:(x::Int),:( # line 4:),:y})
@@ -40,7 +40,7 @@ Enter MacroTools:
4040
```julia
4141
julia> using MacroTools
4242

43-
julia> @capture(ex, type T_ fields__ end)
43+
julia> @capture(ex, struct T_ fields__ end)
4444
true
4545

4646
julia> T, fields
@@ -91,12 +91,12 @@ Another common use case is to catch symbol literals, e.g.
9191
9292
```julia
9393
@capture(ex,
94-
type T_Symbol
94+
struct T_Symbol
9595
fields__
9696
end)
9797
```
9898
99-
which will match e.g. `type Foo ...` but not `type Foo{V} ...`
99+
which will match e.g. `struct Foo ...` but not `struct Foo{V} ...`
100100
101101
### Unions
102102

0 commit comments

Comments
 (0)