brownplt / pyret-lang

The Pyret language.
Other
1.07k stars 110 forks source link

Awkward function name from sugar #1284

Closed sorawee closed 6 years ago

sorawee commented 6 years ago
for lam(x): x end():
  1
end

results in

<function:for-body<line 1, column 0>>
blerner commented 6 years ago

I'm not particularly concerned by this: this is a particularly obtuse way of using lambdas and for-syntax, so it's not likely to come up particularly often. And while we need some kind of name here, I don't think this one's particularly worse than others. The display-name of a function is not part of the semantics of Pyret...

jpolitz commented 6 years ago

Yeah this seems pretty reasonable. I don't know of a qualitatively different alternative than using the location of the for body.