Skip to content

Contradiction causes segfault #5

@BruceDLong

Description

@BruceDLong
  1. [4,5,6] returns the last element (6), as it should.
  2. [_,5,6] <: +4 sets the first item to 4 and returns 6. It should
  3. [4,5,6] <: +4 also works correctly.
  4. [4,5,6] <: +3 notes that there is a contradiction. 4!=3. This causes it to assume that the 3 may be a null match and it creates an "alt" to represent that. This eventually results in a segfault.

I'm currently leaving the segfault because I haven't figured out the best way to handle this.

An even shorter example is:

+3 = +4

which prints "CONTRADICTION!" then segfaults. We need a better plan for what to do with contradictions.
The problem is that contradictions also signal the end of a list. e.g., the end of a repeated pattern match.
So it must detect the difference. (Which is the essence of this issue; what is the best way to detect the situation and what is to be done.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions