Mercurial Hosting > luan
comparison src/luan/modules/JavaLuan.java @ 1561:e1a13e707bf3
start immutable
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 05 Nov 2020 20:24:09 -0700 |
parents | 8d95711f6615 |
children | b89212fd04b5 |
comparison
equal
deleted
inserted
replaced
1560:33a53c43e2f7 | 1561:e1a13e707bf3 |
---|---|
21 import luan.LuanTable; | 21 import luan.LuanTable; |
22 import luan.LuanException; | 22 import luan.LuanException; |
23 import luan.LuanFunction; | 23 import luan.LuanFunction; |
24 import luan.LuanJavaFunction; | 24 import luan.LuanJavaFunction; |
25 import luan.LuanCloner; | 25 import luan.LuanCloner; |
26 import luan.LuanImmutabler; | |
26 | 27 |
27 | 28 |
28 public final class JavaLuan { | 29 public final class JavaLuan { |
29 | 30 |
30 public static void java(Luan luan) throws LuanException { | 31 public static void java(Luan luan) throws LuanException { |
377 | 378 |
378 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { | 379 @Override protected void completeClone(LuanFunction dc,LuanCloner cloner) { |
379 AmbiguousJavaFunction clone = (AmbiguousJavaFunction)dc; | 380 AmbiguousJavaFunction clone = (AmbiguousJavaFunction)dc; |
380 clone.fnMap = (Map)cloner.clone(fnMap); | 381 clone.fnMap = (Map)cloner.clone(fnMap); |
381 clone.varArgs = (List)cloner.clone(varArgs); | 382 clone.varArgs = (List)cloner.clone(varArgs); |
383 // no call to super? | |
384 } | |
385 | |
386 @Override public void makeImmutable(LuanImmutabler immutabler) throws LuanException { | |
387 immutabler.makeImmutable(fnMap); | |
388 immutabler.makeImmutable(varArgs); | |
389 super.makeImmutable(immutabler); | |
382 } | 390 } |
383 | 391 |
384 @Override public Object call(Object[] args) throws LuanException { | 392 @Override public Object call(Object[] args) throws LuanException { |
385 List<LuanJavaFunction> list = fnMap.get(args.length); | 393 List<LuanJavaFunction> list = fnMap.get(args.length); |
386 if( list != null ) { | 394 if( list != null ) { |