Skip to content

Instantly share code, notes, and snippets.

@nasser
Created April 15, 2020 15:49
Show Gist options
  • Save nasser/dc7966593800c7353e9b4d329b938489 to your computer and use it in GitHub Desktop.
Save nasser/dc7966593800c7353e9b4d329b938489 to your computer and use it in GitHub Desktop.
Reify Metadata Progress
public sealed class reify50835 : Counted, IObj
{
private readonly int x;
private readonly IPersistentMap <meta>;
private static IPersistentMap <static_meta>;
public reify50835(int num)
{
this.x = num;
}
public reify50835(IPersistentMap persistentMap, int num) : this(num)
{
this.<meta> = persistentMap;
}
public int count()
{
return this.x;
}
public IObj withMeta(IPersistentMap persistentMap)
{
return new reify50835(persistentMap, this.x);
}
public IPersistentMap meta()
{
if (this.<meta> != null)
{
return this.<meta>;
}
if (reify50835.<static_meta> == null)
{
reify50835.<static_meta> = (IPersistentMap)((APersistentMap)RT.mapUniqueKeys(new object[]
{
Keyword.intern(null, "foo"),
12L
}));
}
return reify50835.<static_meta>;
}
}
public class magic-eval
{
public void top-level()
{
new user$fn$50837();
}
}
public class user$fn$50837 : AFunction, Function<reify50835, object>, Function<object, object>
{
public override bool HasArity(int num)
{
return num == 1;
}
public override reify50835 invoke(object y)
{
int num = 10;
return new reify50835(num);
}
public override object invoke(object y)
{
return this.invoke(y);
}
}
(let [x (int 10)
r ^{:foo 12}
(reify
clojure.lang.Counted
(count [_] x))]
r)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment