Skip to content

Commit

Permalink
doc: add @ to help (JuliaLang#33824)
Browse files Browse the repository at this point in the history
Co-authored-by: jaideep-seth <jaideepnseth@gmail.com>

Co-authored-by: Jameson Nash <vtjnash@gmail.com>
  • Loading branch information
2 people authored and johanmon committed Jul 5, 2021
1 parent bedb927 commit 6ad8bf4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
12 changes: 12 additions & 0 deletions base/docs/basedocs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,18 @@ For other purposes, `:( ... )` and `quote .. end` blocks are treated identically
"""
kw"quote"

"""
@
The at sign followed by a macro name marks a macro call. Macros provide the
ability to include generated code in the final body of a program. A macro maps
a tuple of arguments, expressed as space-separated expressions or a
function-call-like argument list, to a returned *expression*. The resulting
expression is compiled directly into the surrounding code. See
[Metaprogramming](@ref man-macros) for more details and examples.
"""
kw"@"

"""
{}
Expand Down
18 changes: 9 additions & 9 deletions doc/src/base/punctuation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@

Extended documentation for mathematical symbols & functions is [here](@ref math-ops).

| symbol | meaning |
|:----------- |:----------------------------------------------------------------------------------------------------------------------------------------------- |
| `@m` | the at-symbol invokes [macro](@ref man-macros) `m`; followed by space-separated expressions or a function-call-like argument list |
| symbol | meaning |
|:----------- |:--------------------------------------------------------------------------------------------|
| `@` | the at-sign marks a [macro](@ref man-macros) invocation; optionally followed by an argument list |
| [`!`](@ref) | an exclamation mark is a prefix operator for logical negation ("not") |
| `a!` | function names that end with an exclamation mark modify one or more of their arguments by convention |
| `#` | the number sign (or hash or pound) character begins single line comments |
| `#=` | when followed by an equals sign, it begins a multi-line comment (these are nestable) |
| `#=` | when followed by an equals sign, it begins a multi-line comment (these are nestable) |
| `=#` | end a multi-line comment by immediately preceding the number sign with an equals sign |
| `$` | the dollar sign is used for [string](@ref string-interpolation) and [expression](@ref man-expression-interpolation) interpolation |
| [`%`](@ref rem) | the percent symbol is the remainder operator |
| [`^`](@ref) | the caret is the exponentiation operator |
| [`^`](@ref) | the caret is the exponentiation operator |
| [`&`](@ref) | single ampersand is bitwise and |
| [`&&`](@ref)| double ampersands is short-circuiting boolean and |
| [`\|`](@ref)| single pipe character is bitwise or |
Expand All @@ -31,7 +31,7 @@ Extended documentation for mathematical symbols & functions is [here](@ref math-
| `[,]` | [vector literal constructor](@ref man-array-literals) (calling [`vect`](@ref Base.vect)) |
| `[;]` | [vertical concatenation](@ref man-array-concatenation) (calling [`vcat`](@ref) or [`hvcat`](@ref)) |
| `[   ]` | with space-separated expressions, [horizontal concatenation](@ref man-concatenation) (calling [`hcat`](@ref) or [`hvcat`](@ref)) |
| `T{ }` | curly braces following a type list that type's [parameters](@ref Parametric-Types) |
| `T{ }` | curly braces following a type list that type's [parameters](@ref Parametric-Types) |
| `{}` | curly braces can also be used to group multiple [`where`](@ref) expressions in function declarations |
| `;` | semicolons separate statements, begin a list of keyword arguments in function declarations or calls, or are used to separate array literals for vertical concatenation |
| `,` | commas separate function arguments or tuple or array components |
Expand All @@ -55,6 +55,6 @@ Extended documentation for mathematical symbols & functions is [here](@ref math-
| [`==`](@ref)| double equals sign is value equality comparison |
| [`===`](@ref) | triple equals sign is programmatically identical equality comparison |
| [`=>`](@ref Pair) | right arrow using an equals sign defines a [`Pair`](@ref) typically used to populate [dictionaries](@ref Dictionaries) |
| `->` | right arrow using a hyphen defines an [anonymous function](@ref man-anonymous-functions) on a single line |
| `|>` | pipe operator passes output from the left argument to input of the right argument, usually a [function](@ref Function-composition-and-piping) |
| `` | function composition operator (typed with \circ{tab}) combines two functions as though they are a single larger [function](@ref Function-composition-and-piping) |
| `->` | right arrow using a hyphen defines an [anonymous function](@ref man-anonymous-functions) on a single line |
| `|>` | pipe operator passes output from the left argument to input of the right argument, usually a [function](@ref Function-composition-and-piping) |
| `` | function composition operator (typed with \circ{tab}) combines two functions as though they are a single larger [function](@ref Function-composition-and-piping) |
2 changes: 1 addition & 1 deletion doc/src/manual/metaprogramming.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ julia> eval(ex)

## [Macros](@id man-macros)

Macros provide a method to include generated code in the final body of a program. A macro maps
Macros provide a mechanism to include generated code in the final body of a program. A macro maps
a tuple of arguments to a returned *expression*, and the resulting expression is compiled directly
rather than requiring a runtime [`eval`](@ref) call. Macro arguments may include expressions,
literal values, and symbols.
Expand Down

0 comments on commit 6ad8bf4

Please sign in to comment.