tov / dssl2

A data structures student language, version 2
MIT License
9 stars 5 forks source link

Suboptimal error message when setting non-existing field #19

Open stamourv opened 4 years ago

stamourv commented 4 years ago

Consider this program:

#lang dssl2
class Foo[X]:
    let _data
    def __init__(self):
        self.data = 10 # wrong var name

which produces the error:

bug-hw5.rkt:7:13: set!: unbound identifier
  at: «Foo».data
  in: (set! «Foo».data 10)

That error message isn't too bad (it clearly shows the field name at fault), but the fact that it it's terms of set! isn't great.

FWIW, that happens only for class fields. Not for either local or global variables.

tov commented 4 years ago

I think it doesn’t do any checking for this.