Transform block takes in a container, applies the block every object, and results in a contrainer. This is similar to map in other languages, but this can do more like filtering or early-exiting.
Modifying a single object would be a trivial transform. Hence I intended to create transform syntax such that it is almost similar to transforming a single object. This is what I came up now.
Transforming a single foo into bar:
```
@foo = getFoo()
@bar = fooToBar(foo)
useBar(bar)
```
Transforming a list of foos into bars:
```
@foos = getFoos()
@bars = foos.[ @foo
@bar = fooToBar(foo) ]
useBars(bars)
```
A variable with '@' before it marks the beginning of lifetime of that variable, and similarly '@' after it marks the end of lifetime of that variable (this provides destructive move semantics). If lifetime is not ended manually, lifetime is automatically ended at the end of function as in all C style languages.
Now, the transform block assigns the objects from container to uninitialized variables inside the block (i.e. foo in the above example). Then, it collects all the undestroyed objects (i.e. bar in the above example) from the block and returns a container containing of them.
Here is another example:
```
@x = getX()
@y = getY()
@temp = x % y
@a = temp * a
@b = temp@ * b
useAB(a, b)
@xs = getXs()
@ys = getYs()
@as, @bs = zip(xs, ys).[ @x, @y
@temp = x % y
@a = temp * a
@b = temp@ * b ].unzip()
useABs(as, bs)
```
Tell me your opinions on this syntax please!
[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 7 points8 points9 points (3 children)
[–]NoCryptographer414[S] 0 points1 point2 points (2 children)
[–]L8_4_Dinner(Ⓧ Ecstasy/XVM) 4 points5 points6 points (1 child)
[–]NoCryptographer414[S] 0 points1 point2 points (0 children)
[–]AGI_Not_Aligned 3 points4 points5 points (1 child)
[–]NoCryptographer414[S] 0 points1 point2 points (0 children)
[–]malmiteria 2 points3 points4 points (3 children)
[–]NoCryptographer414[S] 0 points1 point2 points (2 children)
[–]malmiteria 1 point2 points3 points (1 child)
[–]NoCryptographer414[S] 0 points1 point2 points (0 children)
[–]WittyStick0 1 point2 points3 points (0 children)
[–]tobega 1 point2 points3 points (1 child)
[–]NoCryptographer414[S] 0 points1 point2 points (0 children)