Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Array slicing
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
===1964: [[PL/I]]=== PL/I provides two facilities for array slicing. * Using ''iSub DEFINING'', an array slice can be declared using ''iSUB'' variables to map specific elements in a "base array" onto elements of the "defined array". iSUBs can define rows, columns, diagonals, or many-to-one mappings.<ref name=PLI>{{cite book |last1=IBM Corporation |title=PL/I for MVS & VM Language Reference |date=1995}}</ref>{{rp|pp.212β213}} The following example defines <code>Y</code> as a one-dimensional slice consisting of the diagonal elements of the two-dimensional array <code>X</code>. DECLARE X(5,5); DECLARE Y(5) DEFINED(X(1SUB,1SUB)); A reference to <code>Y(2)</code> is a reference to <code>X(2,2)</code>, and so on. * A slice, called a ''cross-section'', of an array can be referred to by using asterisk as the subscript for one or more dimensions. The following code sets all the elements in the first column of <code>X</code> to zero. One or more subscripts can be specified by asterisks in an expression.<ref name=PLI />{{rp|p.43}} DECLARE X(5,5); X(*,1)=0;
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)