February 2, 2026

Solution for Loops(for, foreach) in RIDE – Ilya Smagin

Solution for Loops(for, foreach) in RIDE – Ilya Smagin

Solution for Loops(for, foreach) in RIDE – Ilya Smagin

Turing Completeness

while(true) 

Blockchain, RIDE

let arr = getString(this,"key").extract().split("|")
arr.foreach(a => a + "A") # imaginary code
let arr = getString(this,"key").extract().split("|")
arr.map
}
}
let arr = ...
arr.map(10, )
let arr = ...
let steps = arr.size()
arr.map(steps, )
def fold[A](col: List[A], z: A, op: (A, A) ⇒ A): A
def foldLeft[B](col: List[A], z: B, op: (B, A) ⇒ B): B
def foldRight[B](col: List[A], z: B, op: (A, B) ⇒ B): B
func sum(a:Int, b:Int) = a + b
let arr = [1,2,3,4,5]
let sum = FOLD<5>(arr, 0, sum) # result: 15
func filterStep(a: Int, accumulated: List[Int]) = 
if (a % 2 == 0) then a :: acumulated else accumulated
let arr = [1,2,3,4,5]
let evens = FOLD<5>(arr, 0, filterStep) # result: [2,4]*
let result = FOLD<5>(arr, acc0, function)
let restult = }}}}}

Multisig

# array of 8 public keys
let pks = [ ... ]
# inner fold step for each signature
def pkStep(sig: ByteVector, pk:ByteVector, acc: Boolean)
= acc || sigVerify(tx.bodyBytes, sig, pk)

# is signed by the public key or not
def signedBy(pk:ByteVector) = FOLD<8>(sigs, false, pkStep)
# outer fold step for each public key
def signedFoldStep(pk:ByteVector, acc:Int)
= acc + (if(signedBy(pk)) then 1 else 0)

# comparing total number of correct signatures to required number of correct signatures
FOLD<8>(pks, 0, signedFoldStep) == 8

So what, Turing Complete now?

Let’s discuss

Published at Sat, 03 Aug 2019 11:49:15 +0000

Bitcoin Pic Of The Moment
DAVOS/SWITZERLAND, 23JAN15 – David Kirkpatrick , Founder, Chief Executive Officer and Chief Techonomist, Techonomy Media, USA captured during the session From Bucks to Bitcoins in the congress centre at the Annual Meeting 2015 of the World Economic Forum in Davos, January 23, 2015.

WORLD ECONOMIC FORUM/Benedikt von Loebell
By World Economic Forum on 2015-01-23 14:47:52
tags

Previous Article

A Universal Blockchain Investment Solution

Next Article

More Signs the Next Big Financial Crisis May Begin in Germany

You might be interested in …