Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
ion
ion
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 94
    • Issues 94
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 2
    • Merge Requests 2
  • Operations
    • Operations
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • redox-os
  • ionion
  • Issues
  • #482

Closed
Open
Opened Jul 28, 2017 by Michael Aaron Murphy@mmstickMaintainer

Make distinction between value types within Ion

Created by: huntergoldstein

Problem

Everything is, by default, an Array when expanding strings. For example, the expression

$(foo bar baz)

is supposed to expand to a string, but currently this expands to a one element array. There are plenty of other similar cases, for example "" expanding to the empty array versus the empty string.

Solution

Introduce a true value type, something like:

enum Value {
  String(SmallString)
  Array(SmallVec<Value>)
}

Considerations

  • Expressions such as foo @bar, where bar = [0 1 2 ...] currently expand to foo 0 1 2 ... with each element of bar becoming an argument to foo and foo "@bar" for passing bar itself as an argument.
    • Perhaps we have explicit array passing here with foo [@bar]
  • Typed function arguments: do we want to add bool and int types? Also see #480 (closed).
Edited Dec 13, 2020 by matu3ba
Assignee
Assign to
Ion Shell v1.0.0
Milestone
Ion Shell v1.0.0
Assign milestone
Time tracking
None
Due date
None
Reference: redox-os/ion#482