Skip to content

GitLab

  • Menu
Projects Groups Snippets
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • ion ion
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 84
    • Issues 84
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 3
    • Merge requests 3
  • Deployments
    • Deployments
    • Releases
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • redox-os
  • ionion
  • Issues
  • #482
Closed
Open
Created 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
Time tracking