lieuwex / appel

A sane arbitrary precision rational calculator inspired by APL
3 stars 0 forks source link

Error while executing: Function returned non-scalar in map #2

Closed lieuwex closed 1 year ago

lieuwex commented 1 year ago
> fn avg xs = (+//xs)/(rho xs)
fn avg xs = ((+//xs) / rho xs)

> fn f x = x + (avg (1 2))
fn f x = (x + (avg (1 2)))

> f . (iota 10)
error while executing: Function returned non-scalar in map
lieuwex commented 1 year ago

Look like scalars to me:

> f 1
2.5

> f 2
3.5

> f 3
4.5

> f 3
4.5

> f 4
5.5

> 
> f 1
2.5

> f 2
3.5

> f 3
4.5

> f 4
5.5

> f 5
6.5

> f 6
7.5

> f 7
8.5

> f 8
9.5

> f 9
10.5

> f 10
11.5
lieuwex commented 1 year ago

More contrived:

> fn f x = (rho (1 2))
fn f x = rho (1 2)

> f . (iota 10)
error while executing: Function returned non-scalar in map