root/NEWT0/trunk/sample/basicFns.newt

Revision 27, 360 bytes (checked in by gnue, 4 years ago)

change NewtObjGetSlot and NcFullLookupFrame for not frame object

Line 
1// Basic Global Functions
2
3
4global Map(obj, fn)
5begin
6    foreach slot, value in obj do call fn with (slot,value);
7end;
8
9
10global DeepClone(obj)
11begin
12    obj := clone(obj);
13
14    if isFrame(obj) or isArray(obj) then
15        foreach slot,value in obj do obj.(slot) := DeepClone(value);
16
17    return obj;
18end;
19
20
21global GetFunctionArgCount(fn)
22begin
23    return fn.numArgs;
24end;
25
26
27true;
Note: See TracBrowser for help on using the browser.