1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-22 02:58:15 +03:00
mal/chuck/func.ck

36 lines
686 B
Plaintext
Raw Normal View History

2016-05-12 11:01:09 +03:00
public class Func extends MalObject
{
"func" => type;
Env env;
string args[];
MalObject ast;
2016-08-01 11:40:32 +03:00
int isMacro;
2016-05-12 11:01:09 +03:00
2016-08-01 11:40:32 +03:00
fun void init(Env env, string args[], MalObject ast)
2016-05-12 11:01:09 +03:00
{
2016-08-01 11:40:32 +03:00
env @=> this.env;
args @=> this.args;
ast @=> this.ast;
2016-05-12 11:01:09 +03:00
}
2016-08-01 11:40:32 +03:00
fun static Func create(Env env, string args[], MalObject ast)
2016-05-12 11:01:09 +03:00
{
Func func;
2016-08-01 11:40:32 +03:00
func.init(env, args, ast);
2016-05-12 11:01:09 +03:00
return func;
}
2016-08-06 22:25:56 +03:00
fun MalObject clone()
{
Func value;
this.type => value.type;
this.env @=> value.env;
this.args @=> value.args;
this.ast @=> value.ast;
this.isMacro @=> value.isMacro;
return value;
}
2016-05-12 11:01:09 +03:00
}