User Tools

Site Tools


groimp-platform:xl-lambda

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
groimp-platform:xl-lambda [2024/05/06 11:54] TimObgroimp-platform:xl-lambda [2024/05/06 12:05] (current) – [custom rules] TimOb
Line 37: Line 37:
 By using a Object function (eg. ObjectToFloat, BooleanToObject, ObjectToObject) the object can be more specifically defined in the function. By using a Object function (eg. ObjectToFloat, BooleanToObject, ObjectToObject) the object can be more specifically defined in the function.
 For example the follwing lambda function will only work with node of the module A but can therefore also use attributes of this moduel: For example the follwing lambda function will only work with node of the module A but can therefore also use attributes of this moduel:
-<code>+<code java>
  
 ObjectToFloat getLen = A a => float a.len; ObjectToFloat getLen = A a => float a.len;
Line 43: Line 43:
 </code> </code>
  
-This works with module types and interfaces.+This works with module types and interfaces, for example the following code would let all Node implementing the Organ interface add one to the age. 
 +<code java> 
 +public interface organ{ 
 + public int age; 
 + 
 + public void setAge(int a); 
 + public int getAge(); 
 +  
 +
 +public void ageing(){ 
 + ObjectToVoid grow = organ o => void o.setAge(o.getAge()+1); 
 + grow.evaluateVoid((*organ*)); 
 +  
 +
 +</code>
  
 ====== Generators ====== ====== Generators ======
groimp-platform/xl-lambda.txt · Last modified: 2024/05/06 12:05 by TimOb