Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
ion
ion
  • Project
    • Project
    • Details
    • Activity
    • Releases
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 86
    • Issues 86
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • redox-os
  • ionion
  • Issues
  • #778

Closed
Open
Opened Jun 17, 2018 by Michael Aaron Murphy@mmstick3 of 3 tasks completed3/3 tasks
  • Report abuse
  • New issue
Report abuse New issue

Array Assignment Operators

Arithmetic may also be performed on arrays. These operations can be SIMD-accelerated.

  • Add: +=
  • Subtract: -=
  • Divide: /=
  • Integer Divide: //=
  • Multiply: *=
  • Exponent: **=

There are also some array-specific operations:

  • Append (++): Append values to the array
$ let ARRAY = [ 1 2 3 ]
$ let ARRAY ++= 4
$ let ARRAY ++= [5 6 7]
$ echo @ARRAY
1 2 3 4 5 6 7
  • Append-Head (::): Insert values at the beginning of the array
$ let ARRAY = [ 4 5 6 ]
$ let ARRAY ::= [ 1 2 3 ]
$ echo @ARRAY
1 2 3 4 5 6
  • Difference (\\): Retain values which are different from the array on the right
$ let ARRAY = [ 1 2 3 4 5 6 ]
$ let ARRAY \\= [1 3 5]
$ echo @ARRAY
2 4 6
Edited Jul 02, 2018 by stratact
Assignee
Assign to
Ion Shell v1.0.0
Milestone
Ion Shell v1.0.0
Assign milestone
Time tracking
None
Due date
None
1
Labels
Difficult
Assign labels
  • View project labels
Reference: redox-os/ion#778