Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
6
Task/Quoting-constructs/Julia/quoting-constructs-1.julia
Normal file
6
Task/Quoting-constructs/Julia/quoting-constructs-1.julia
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
julia> str = "Hello, world.\n"
|
||||
"Hello, world.\n"
|
||||
|
||||
julia> """Contains "quote" characters and
|
||||
a newline"""
|
||||
"Contains \"quote\" characters and \na newline"
|
||||
5
Task/Quoting-constructs/Julia/quoting-constructs-2.julia
Normal file
5
Task/Quoting-constructs/Julia/quoting-constructs-2.julia
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
julia> str = """
|
||||
Hello,
|
||||
world.
|
||||
"""
|
||||
" Hello,\n world.\n"
|
||||
2
Task/Quoting-constructs/Julia/quoting-constructs-3.julia
Normal file
2
Task/Quoting-constructs/Julia/quoting-constructs-3.julia
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
julia> "$greet, $whom.\n"
|
||||
"Hello, world.\n"
|
||||
2
Task/Quoting-constructs/Julia/quoting-constructs-4.julia
Normal file
2
Task/Quoting-constructs/Julia/quoting-constructs-4.julia
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
julia> "1 + 2 = $(1 + 2)"
|
||||
"1 + 2 = 3"
|
||||
2
Task/Quoting-constructs/Julia/quoting-constructs-5.julia
Normal file
2
Task/Quoting-constructs/Julia/quoting-constructs-5.julia
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
julia> 'π'
|
||||
'π': Unicode U+03C0 (category Ll: Letter, lowercase)
|
||||
8
Task/Quoting-constructs/Julia/quoting-constructs-6.julia
Normal file
8
Task/Quoting-constructs/Julia/quoting-constructs-6.julia
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
julia> mycommand = `echo hello`
|
||||
`echo hello`
|
||||
|
||||
julia> typeof(mycommand)
|
||||
Cmd
|
||||
|
||||
julia> run(mycommand);
|
||||
hello
|
||||
23
Task/Quoting-constructs/Julia/quoting-constructs-7.julia
Normal file
23
Task/Quoting-constructs/Julia/quoting-constructs-7.julia
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
julia> a = :+
|
||||
:+
|
||||
|
||||
julia> typeof(a)
|
||||
Symbol
|
||||
|
||||
julia> b = quote + end
|
||||
quote
|
||||
#= REPL[3]:1 =#
|
||||
+
|
||||
end
|
||||
|
||||
julia> typeof(b)
|
||||
Expr
|
||||
|
||||
julia> eval(a) == eval(b)
|
||||
true
|
||||
|
||||
julia> c = :(2 + 3)
|
||||
:(2 + 3)
|
||||
|
||||
julia> eval(c)
|
||||
5
|
||||
Loading…
Add table
Add a link
Reference in a new issue