Mercurial Hosting > luan
comparison src/luan/modules/BasicLuan.java @ 1561:e1a13e707bf3
start immutable
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 20:24:09 -0700 |
parents | 26c51acf00f3 |
children | b89212fd04b5 |
comparison
equal
deleted
inserted
replaced
1560:33a53c43e2f7 | 1561:e1a13e707bf3 |
---|---|
13 import luan.Luan; | 13 import luan.Luan; |
14 import luan.LuanTable; | 14 import luan.LuanTable; |
15 import luan.LuanFunction; | 15 import luan.LuanFunction; |
16 import luan.LuanException; | 16 import luan.LuanException; |
17 import luan.LuanCloner; | 17 import luan.LuanCloner; |
18 import luan.LuanImmutabler; | |
18 import luan.modules.parsers.LuanToString; | 19 import luan.modules.parsers.LuanToString; |
19 | 20 |
20 | 21 |
21 public final class BasicLuan { | 22 public final class BasicLuan { |
22 | 23 |
69 | 70 |
70 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { | 71 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { |
71 Ipairs clone = (Ipairs)dc; | 72 Ipairs clone = (Ipairs)dc; |
72 clone.list = (List)cloner.clone(list); | 73 clone.list = (List)cloner.clone(list); |
73 super.completeClone(dc,cloner); | 74 super.completeClone(dc,cloner); |
75 } | |
76 | |
77 @Override public void makeImmutable(LuanImmutabler immutabler) throws LuanException { | |
78 throw new LuanException("ipairs cannot be made immutable"); | |
74 } | 79 } |
75 } | 80 } |
76 | 81 |
77 public static LuanFunction ipairs(LuanTable t) throws LuanException { | 82 public static LuanFunction ipairs(LuanTable t) throws LuanException { |
78 Utils.checkNotNull(t); | 83 Utils.checkNotNull(t); |
182 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { | 187 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { |
183 Values clone = (Values)dc; | 188 Values clone = (Values)dc; |
184 clone.args = (Object[])cloner.clone(args); | 189 clone.args = (Object[])cloner.clone(args); |
185 super.completeClone(dc,cloner); | 190 super.completeClone(dc,cloner); |
186 } | 191 } |
192 | |
193 @Override public void makeImmutable(LuanImmutabler immutabler) throws LuanException { | |
194 throw new LuanException("values cannot be made immutable"); | |
195 } | |
187 } | 196 } |
188 | 197 |
189 public static LuanFunction values(final Object... args) throws LuanException { | 198 public static LuanFunction values(final Object... args) throws LuanException { |
190 return new Values(args); | 199 return new Values(args); |
191 } | 200 } |