Skip to content

. for concatenation #4

@HalosGhost

Description

@HalosGhost

Like C, L concatenates adjacent string literals.

However, where C provides a string concatenation function, at the moment, L provides an operator for string concatenation: .

Overloading . in this way (so that the whitespace around it is syntactically meaningful) causes a few pain points.

E.g., where -> (which, at least in C, is equivalent to . but dereferencing its left argument before access) can be spaced however the user would like but . cannot be. Or, what happens when whitespace exists on one side of . but not the other?

I would propose one of two things:

  1. Use an alternative operator (e.g., $$, >< or ##; the latter might be good since C programmers already associate it with concatenation of a sort).
  2. Do not require an operator for string concatenation at all; L already allows for concatenation of string literals, why not just concatenate all adjacent strings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions