Mantis Bugtracker
  

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0005793 [Squeak] ST80 minor always 01-20-07 05:57 05-12-14 19:46
Reporter gilad View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed  
Status resolved   Product Version 3.8
Summary 0005793: Empty blocks do not conform to Blue Book
Description An empty block is defined to return nil. In Squeak, it returns its last argument. This makes very little sense, and is different from other Smalltalks. I suppose you dare not change it, as who knows what code relies on this behavior. To confirm this, define the following method in any class

emptyBlock
^[:x :y :z | ] value:1 value: 2 value: 3

Then create an instance and invoke it. It evaluates to 3 instead of nil.
Additional Information
Attached Files  EmptyBlockResult-M5793-Test.1.cs [^] (727 bytes) 09-27-07 20:46
 EmptyBlockResult-M5793-PatchForOldCompiler.1.cs [^] (1,715 bytes) 09-27-07 20:46
 EmptyBlockResult-M5793-Test.2.cs [^] (827 bytes) 04-03-08 20:37
 EmptyBlockResult-M5793-PatchForOldCompiler.2.cs [^] (1,727 bytes) 04-03-08 20:37

- Relationships

- Notes
(0011216 - 94 - 100 - 100 - 100 - 100 - 100)
nicolas cellier
09-27-07 20:51

Just to exercize, a patch for the old compiler.
Note that the NewCompiler already answer nil.
 
(0011968 - 115 - 127 - 127 - 127 - 127 - 127)
nicolas cellier
04-03-08 20:38

Ah Ah, stupid, just forgot to test if statements were empty...

A test.2.cs and patch.2.cs do it a little better.
 
(0014496 - 153 - 165 - 473 - 473 - 473 - 473)
nicolas cellier
05-12-14 19:46

Fixed in 4.6 trunk by Eliot's
http://source.squeak.org/trunk/Compiler-eem.280.mcz [^]
Some details in https://code.google.com/p/pharo/issues/detail?id=1614 [^]
 

- Issue History
Date Modified Username Field Change
01-20-07 05:57 gilad New Issue
09-27-07 20:46 nicolas cellier File Added: EmptyBlockResult-M5793-Test.1.cs
09-27-07 20:46 nicolas cellier File Added: EmptyBlockResult-M5793-PatchForOldCompiler.1.cs
09-27-07 20:51 nicolas cellier Note Added: 0011216
04-03-08 20:37 nicolas cellier File Added: EmptyBlockResult-M5793-Test.2.cs
04-03-08 20:37 nicolas cellier File Added: EmptyBlockResult-M5793-PatchForOldCompiler.2.cs
04-03-08 20:38 nicolas cellier Note Added: 0011968
08-12-09 02:52 lewis Issue Monitored: lewis
05-12-14 19:46 nicolas cellier Status new => resolved
05-12-14 19:46 nicolas cellier Fixed in Version  => trunk
05-12-14 19:46 nicolas cellier Resolution open => fixed
05-12-14 19:46 nicolas cellier Assigned To  => nicolas cellier
05-12-14 19:46 nicolas cellier Note Added: 0014496


Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
55 total queries executed.
36 unique queries executed.
Powered by Mantis Bugtracker