From APL Wiki
Jump to navigation Jump to search

Array model

I've marked Ivy as flat, because it's clearly not intended for computation on nested arrays. The examples and tests only ever show flat arrays, and nested arrays, when created, are often not formatted correctly. However, it's possible to create a nested array with an expression such as ,\ iota 4 or "abc" o., "de". I think this is because the implementation has dedicated types for numbers and characters, but these aren't kept separate from the array types vector (rank 1) and matrix (arbitrary rank). So more accurately the current implementation of Ivy might be considered a based or nested language that opens scalars (including non-simple ones) whenever they show up. That's confusing and probably not really the creator's intent, so I'm only mentioning it here. Marshall (talk) 19:50, 5 February 2021 (UTC)

Official support for nesting was added in this commit, which also confirms that the ability to create nested arrays before was unintentional. As of v0.3.1 it seems to be impossible to create scalar arrays, as the few functions that would do this either open the result (reduce, selection) or otherwise avoid rank 0 (dyadic rho treats an empty left argument as 0). Which I think means it could equally be described as nested without non-simple scalars, or based without scalar arrays. --Marshall (talk) 20:57, 15 August 2023 (UTC)

Features - recursion

Not sure it can be said that ivy has no recursion.

op fact x = x<=1: 1; x*fact(x-1)

fact 5

Regards, —Mykhal (talk) 12:40, 16 December 2022 (UTC)