JM° 0.15 - 26.10.2020

Tree-Block

tree = >>>>
	body
		font-size: 16px
		margin: 20px
		line-height: 1.5
	b, strong
		font-weight: bold
<<<<

tree.show

Tree

t = Tree
t.add("Foo")
t.add("Bar")
t.show
t.get("Foo").add("Boo")
t.get("Bar").pull("Xar").pull("Tar")
t.show
t["Foo","Too","Zoo"]?
t["Bar","Xar","Tar"] = "War"

Auto-Propertys

For propertys, "Get" can be left out:

::getValueX = "myValue"
_THIS.getValueX.print
_THIS.valueX.print

For "Set" a '=' must be added:

::setValueX(x)
	x.toStr.print
_THIS.setValueX(9)
_THIS.valueX = 9

Cutting Strings

Some methods are changed

s = "abcabc"
Starting from position
s.start(3)
cabc
End at position
s.end(3)
# abc
From (first) sequence
s.from("c")
cabc
From first sequence
s.fromFirst("c")
cabc
From last sequence
s.fromLast("c")
c
After (first) sequence
s.after("c")
abc
After first sequence
s.afterFirst("c")
abc
After last sequence
s.afterLast("c")
 
Before (first) sequence
s.before("c")
ab
Before first sequence
s.beforeFirst("c")
ab
Before last sequence
s.beforeLast("c")
abcab
To (first) sequence
s.to("c")
abc
To first sequence
s.toFirst("c")
abc
To last sequence
s.toLast("c")
abcabc
Begin string with
s.begin("c")
cabcabc
Append to string
s.append("c")
abcabcc

Create a temporary VarLet as handle vor VarArgs

Object.handle now creates a temporary VarLet to the current object

h = 8.handle
h.get.print

Shortcuts for _EACH

As shortcut for _EACH you can use € and £

l = [4,9,8,2,7,3,6,5]
l.map( $$++ ).print
l.map( €++ ).print

Overwrite .toStr

::toStr = "My own string!"
°print
_THIS.print

Hot execution

Execute a String at runtime

a = 11
# Runs in container
_JMO.exec("a = 22; a.print")
a.print
# This also
"a = 33; a.print".jmo
a.print

Execution with full access to the environment.

>unsafeHotCode
# With full access to variables
_APP.exec("a = 44; a.print")
a.print

Order of arguments for .set and .put changed!

New order: Object, position1, position2, position3, ...

So its clearer: Put/Set that Object there! And it's possible to use a List (VarLet-Handle) for VarArgs

t = Table(2).add(1,2).add(3,4)
t.set(9, 2, 1)
t.put(8, 1, 3)
t.print

Now "[X, Y] = Object" is the shortcut for: "set(Object, X, Y)"

Curly brackets removed, deep-functions integrated in .get, .put, ...

l = [[[2,3]]]
l[1,1,2].print
l.get(1,1,2).print

Deep-Functionality also for Table

t = Table(2)
t.add([11,12],[13,14]).add([21,22],[23,24])
t.get(2,1,2).print

Same with .get, .pull, .set, .put

Sequence.select

l = Range('a','i').toList.print
l.select( 3,5,1,2,8 ).print
l.selectLazy( 1,3,5,7,11,13 ).print

Same for Table, Map, ...

jmo_ext.jar

BrickLinkAPI

Set a maximum of allowed calls, to respect Bricklink-limits.

BrickLinkAPI.setLimit(4000)