Catamorphism: Difference between revisions

m
Line 2,828:
{{trans|FreeBASIC}}
uBasic/4tH has only got one single array so passing its address makes little sense. Instead, its bounds are passed.
<lang>Push 5, 4, 3, 2, 1: For xs = 0 To 4: @Used(x) = Pop():- Next1
For x = 0 To s: @(x) = Pop(): Next
 
Print "Sum is : "; FUNC(_reduce(0, 4s, _add))
Print "Difference is : "; FUNC(_reduce(0, 4s, _subtract))
Print "Product is : "; FUNC(_reduce(0, 4s, _multiply))
Print "Maximum is : "; FUNC(_reduce(0, 4s, _max))
Print "Minimum is : "; FUNC(_reduce(0, 4s, _min))
Print "No op is : "; FUNC(_reduce(0, 4s, _noop))
End
 
374

edits