readonly - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

The Readonly Indexing Function

 Calling Sequence table(readonly, ...)

Description

 • The readonly indexing function is used to create a table for which assigning new entries is illegal. Any object can be initially stored in a table that uses the readonly indexing function, but trying to into the table will raise an exception.

Examples

only empty readonly tables can be created directly

 > $\mathrm{table}\left('\mathrm{readonly}',\left[\right]\right)$
 ${table}{}\left({\mathrm{readonly}}{,}\left[\right]\right)$ (1)
 > $\mathrm{table}\left('\mathrm{readonly}',\left[a=1,b=2\right]\right)$

non-empty read only tables can created by replacing a indexing function in an existing table, with readonly

 > $T≔\mathrm{subsop}\left(1='\mathrm{readonly}',\mathrm{table}\left(\left[a=1,b=2\right]\right)\right)$
 ${T}{≔}{table}{}\left({\mathrm{readonly}}{,}\left[{a}{=}{1}{,}{b}{=}{2}\right]\right)$ (2)
 > $T\left[a\right]$
 ${1}$ (3)
 > $T\left[c\right]≔1$
 > $T\left[a\right]≔1$