Skip to content

Potential repl bug #130

@timfennis

Description

@timfennis

Raw dump of repl


λ let data = read_file("gone_checked.csv");
λ [line.split(",").map(last).int for line in data.lines]
error[vm]: arg 0: expected list, got String
  ┌─ <repl:2>:1:18
  │
1 │ [line.split(",").map(last).int for line in data.lines]
  │                  ^^^ related to this

λ [line.split(",") .map(last).int for line in data.lines[1..]]
error[vm]: arg 0: expected string, got ()
  ┌─ <repl:3>:1:50
  │
1 │ [line.split(",") .map(last).int for line in data.lines[1..]]
  │                                                  ^^^^^ related to this

λ data.lines
error[vm]: arg 0: expected string, got Function(String) -> List<String>
  ┌─ <repl:4>:1:6
  │
1 │ data.lines
  │      ^^^^^ related to this

λ lines(dat)
error[resolver]: Identifier dat has not previously been declared
  ┌─ <repl:5>:1:7
  │
1 │ lines(dat)
  │       ^^^ related to this

λ lines(data)
error[vm]: arg 0: expected string, got Function(String) -> List<String>
  ┌─ <repl:6>:1:1
  │
1 │ lines(data)
  │ ^^^^^ related to this

λ data

thread 'main' (1828837) panicked at ndc_vm/src/vm.rs:200:47:
index out of bounds: the len is 0 but the index is 0
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Shit  ndc
λ

I'm able to reproduce this bug if I set data to "a,b,c\na,b,c\n"

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