June 2018 Update
This commit is contained in:
parent
ba8067c3b7
commit
22f33d4004
5278 changed files with 84726 additions and 14379 deletions
|
|
@ -0,0 +1,17 @@
|
|||
using System;
|
||||
using System.Dynamic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class Program
|
||||
{
|
||||
public static void Main()
|
||||
{
|
||||
string varname = Console.ReadLine();
|
||||
//Let's pretend the user has entered "foo"
|
||||
dynamic expando = new ExpandoObject();
|
||||
var map = expando as IDictionary<string, object>;
|
||||
map.Add(varname, "Hello world!");
|
||||
|
||||
Console.WriteLine(expando.foo);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1 @@
|
|||
42 readln set
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
print("Insert the variable name: ")
|
||||
|
||||
variable = Symbol(readline(STDIN))
|
||||
expression = quote
|
||||
$variable = 42
|
||||
println("Inside quote:")
|
||||
@show $variable
|
||||
end
|
||||
|
||||
eval(expression)
|
||||
|
||||
println("Outside quote:")
|
||||
@show variable
|
||||
println("If I named the variable x:")
|
||||
@show x
|
||||
|
|
@ -2,10 +2,10 @@ our $our-var = 'The our var';
|
|||
my $my-var = 'The my var';
|
||||
|
||||
my $name = prompt 'Variable name: ';
|
||||
my $value = $::($name); # use the right sigil, etc
|
||||
my $value = $::('name'); # use the right sigil, etc
|
||||
|
||||
put qq/Var ($name) starts with value 「$value」/;
|
||||
|
||||
$::($name) = 137;
|
||||
$::('name') = 137;
|
||||
|
||||
put qq/Var ($name) ends with value 「{$::($name)}」/;
|
||||
put qq/Var ($name) ends with value 「{$::('name')}」/;
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
read name
|
||||
declare $name=42
|
||||
echo "${name}=${!name}"
|
||||
Loading…
Add table
Add a link
Reference in a new issue