-
Yacq
+Yacq の式ノード型階層の頂点
-
AmbiguousLambda
曖昧な (型が推論される) ラムダ
-
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<expression z:Id="i1" i:type="Block" xmlns="http://yacq.net/schema" xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns:z="http://schemas.microsoft.com/2003/10/Serialization/"> | |
<Variables> | |
<Parameter z:Id="i2"> | |
<Type z:Id="i3"> | |
<Assembly z:Id="i4" /> | |
<Name>System.Int32[]</Name> | |
</Type> | |
<Name>a</Name> | |
</Parameter> | |
</Variables> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Expression expr = YacqServices.Parse("Int32.(Parse '123').(ToString 'x2')"); | |
SerializedExpression serializedExpr = YacqExpression.Serialize(expr); | |
var dumpedString = serializedExpr.SaveText(); | |
SerializedExpression deserializedExpr = YacqExpression.LoadText(dumpedString); | |
expr = deserializedExpr.Reduce(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
internal static Node Serialize(Expression expression) | |
{ | |
switch (expression.NodeType) | |
{ | |
case ExpressionType.Add: | |
return Add((BinaryExpression) expression); | |
case ExpressionType.AddChecked: | |
return AddChecked((BinaryExpression) expression); | |
case ExpressionType.And: | |
return And((BinaryExpression) expression); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Linq.Expressions; | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
new [] {"foo", "", "bar", null, "baz", " "} | |
.Where(Invert<Func<String, Boolean>>(String.IsNullOrWhiteSpace)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// :Program.:Impl | |
internal static void <Main>:Impl() | |
{ | |
File.ReadLines("a.log").ForEach(delegate(string $0) | |
{ | |
Console.WriteLine($0); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var ws = new WebSocket('ws://localhost:3966'); | |
ws.onmessage = function (ev) { | |
var e = JSON.parse(ev.data); | |
console.log(e); | |
}; | |
ws.send(JSON.stringify({tabs: ['適当な流量のタブの名前']})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
using System.Reflection; | |
internal static class Program | |
{ | |
private static void Main() | |
{ | |
var asm = Assembly.Load("ClassLibrary1"); | |
var type = asm.GetType("Class"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Reflection; | |
namespace TrimStringTest | |
{ | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static IEnumerable<Expression> Unquote(Expression expression, SymbolTable symbols, Int32 level) | |
{ | |
return (expression as ListExpression).Null(el => el[0].Id().Let(i => i == "quasiquote" | |
? Unquote(el[1], symbols, ++level) | |
: i == "unquote" | |
? EnumerableEx.Generate( | |
el, | |
_ => _ != null && _[0].Id() == "unquote", | |
_ => _[1] as ListExpression, | |
_ => _[1] |