Exemple #1
0
 public APad ProcessClick(int logicalX, int logicalY)
 {
     if (LastCommand.IsOneOf(CommandType.Continue, CommandType.WaitClick))
     {
         return(From(Program, Exp.Call(Program, Memory.ToExp(), CoreImplementations.Pair(logicalX, logicalY))));
     }
     throw new InvalidOperationException(LastCommand.ToString());
 }
 public static Exp ToExp(this Data?data)
 {
     return(data switch
     {
         null => CoreImplementations.emptyList,
         NumData n => n.Value,
         PairData pair => CoreImplementations.Pair(pair.Value.ToExp(), pair.Next.ToExp()),
         _ => throw new NotSupportedException($"{data}")
     });
Exemple #3
0
 public static APad Boot(Exp prog)
 {
     return(From(prog, Exp.Call(prog, CoreImplementations.emptyList, CoreImplementations.Pair(0, 0))));
 }