-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathstd.txt
41 lines (39 loc) · 1.15 KB
/
std.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
"SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co.,Ltd.",
"Unilang standard library initialization.";
"This file is a component of Unilang installation.",
"To keep the environment well-formed,",
" users shall not modify the content in this file.";
$def! std.classes $let ()
(
$def! impl__ $provide!
(
class?
make-class
object?
make-object
$access
)
(
$def! (encapsulate-class% class? decapsulate-class)
() make-encapsulation-type;
$defl! make-class (base ctor)
encapsulate-class% (list base ctor);
$defl! ctor-of (c) first (rest% (decapsulate-class c));
$defl! base-of (c) first (decapsulate-class c);
$defl! apply-ctor (c self args)
apply (ctor-of c) (list* self args);
$def! (encapsulate-object% object? decapsulate-object)
() make-encapsulation-type;
$defl! make-object (c .args)
(
$def! self () make-environment;
$def! base base-of c;
$if (null? base) () (apply-ctor base self ());
apply-ctor c self args;
encapsulate-object% (move! self)
);
$defv%! $access (&o &id) d
eval% id (decapsulate-object (eval% o d));
);
() lock-current-environment
);