Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,13 @@
import "meta" for Meta
var genericClass = Fn.new { |cname, fname|
var s1 = "class %(cname) {\n"
var s2 = "construct new(%(fname)){\n_%(fname) = %(fname)\n}\n"
var s3 = "%(fname) { _%(fname) }\n"
var s4 = "}\nreturn %(cname)\n"
return Meta.compile(s1 + s2 + s3 + s4).call() // returns the Class object
}
var CFoo = genericClass.call("Foo", "bar")
var foo = CFoo.new(10)
System.print([foo.bar, foo.type])