3 ms·
> Smalltalk stands in stark disproval of this assertion. I stand corrected. Although Smalltalk solves it by introducing a special method call syntax (which is
by judofyr 14y ago
> Smalltalk stands in stark disproval of this assertion.
I stand corrected. Although Smalltalk solves it by introducing a special method call syntax (which is perfectly fine). I was mostly thinking about C-style-method-call-syntax when I wrote this (Perl, Python, JS).
> They do, if you define a variable within the block it'll be local to the block. Ruby 1.9 even allowed shadowing variables from the parent method (which isn't possible in 1.8)
I did mention explicitly that I wasn't talking about variable scope, so yeah, we're both correct :)
- prodigal_erik 14y ago"Dynamic extent" might be close to what you're talking about. That's what Common Lisp calls the hint that an object may be stack allocated because it's unused after the call.
- masklinn 14y ago> Although Smalltalk solves it by introducing a special method call syntax (which is perfectly fine). Meh. Smalltalk comes from a time when not all languages had to be ALGOL-style, so it just has its own syntax. > I was mostly thinking about C-style-method-call-syntax when I wrote this (Perl, Python, JS). That is no issue, if you have first-class blocks. At most you'll have commas between your blocks because they'll be arguments like every other. Here's a python-ish version using chevrons for blocks: error = (request.form['username'] != app.config['USERNAME']).then(⟨ "Invalid Username" ⟩, else=⟨ None ⟩)