Mantis Bugtracker
  

Viewing Issue Advanced Details Jump to Notes ] View Simple ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0004867 [Squeak] Compiler minor always 09-10-06 22:44 04-18-10 22:05
Reporter lewis View Status public  
Assigned To nicolas cellier
Priority normal Resolution fixed Platform
Status closed   OS
Projection none   OS Version
ETA none Fixed in Version 3.10.2bc Product Version 3.9
  Product Build
Summary 0004867: argument of ifNotNil: must be a 0-argument block, code does not match compiler inlining behavior
Description "Object new ifNotNil: [:object | ]" results in the syntax error "argument of ifNotNil: must be a 0-argument block" when the code appears as if it would allow this.
  
ProtoObject>>ifNotNil: ifNotNilBlock
        "Evaluate the block, unless I'm == nil (q.v.)"
         ^ ifNotNilBlock valueWithPossibleArgs: {self}

The compiler inlines the method, and enforces the zero-argument restriction. The Smalltalk method code has been changed in a way that is inconsistent with this.
Steps To Reproduce
Additional Information This was reported by Zulq Alam on the squeak-dev list, and discussed on the list.
Attached Files  ProtoObject-ifNotNil.st [^] (266 bytes) 09-11-06 03:15

- Relationships
parent of 0006426closed Keith_Hodges ifNotNil: don't accept monadic blocks 

- Notes
(0007052 - 475 - 615 - 615 - 615 - 615 - 615)
wiz
09-11-06 03:20

uploaded the previous version from 3.7 for reversion.

'From Squeak3.8alpha of ''17 July 2004'' [latest update: #5976] on 10 September 2006 at 9:13:08 pm'!

!ProtoObject methodsFor: 'testing' stamp: 'md 11/24/1999 19:25'!
ifNotNil: ifNotNilBlock
    "Evaluate the block, unless I'm == nil (q.v.)"

    ^ ifNotNilBlock value! !

historical note: the version in 3.9g has the stamp:

md 1/20/2006 16:19 ProtoObject ifNotNil: {testing}

Yours in service, -- Jerome Peace
 
(0012936 - 35 - 35 - 35 - 35 - 35 - 35)
lewis
01-28-09 01:25

Note: This has been fixed in Pharo.
 
(0012939 - 340 - 406 - 406 - 406 - 406 - 406)
wiz
01-30-09 03:16

Hi Dave,

I am confused by your comment.

Which way did Pharo resolve the problem?
It seemed to me they were leaning towards the allowance of
an argument.

Is there a test to demonstrate the proper behavior. In an ambiguous
situation such as this I think a test would be critical.

Yours in curiosity and service, --Jerome Peace
 
(0012940 - 248 - 248 - 248 - 248 - 248 - 248)
lewis
01-30-09 12:20

It seems to be fixed in Pharo in the sense that the code matches the compiler behavior, which was the subject of this bug report. I can't comment as to what the correct behavior should be (but see discussions on squeak-dev and pharo mailing lists).
 
(0012941 - 355 - 397 - 397 - 397 - 397 - 397)
wiz
02-02-09 22:01

Um.
The discussions on the Pharo list are what confused me.
And not looking at the Pharo code I still don't understand if
the code now forbids an argument
or if the pharo compliler now permits it.
If it was the code that changed then it would be useful to squeak 3.11 if the fileout patch were uploaded here.

Yours in curiosity and service --Jer
 
(0013316 - 97 - 103 - 103 - 191 - 191 - 191)
nicolas cellier
09-19-09 21:06

This is the same bug as 0006426 and has been fixed in the same time.
It is at least fixed in trunk
 

- Issue History
Date Modified Username Field Change
09-10-06 22:44 lewis New Issue
09-10-06 22:46 lewis Issue Monitored: lewis
09-11-06 03:15 wiz File Added: ProtoObject-ifNotNil.st
09-11-06 03:20 wiz Note Added: 0007052
04-19-07 19:31 wiz Relationship added parent of 0006426
08-23-07 02:12 mikevdg Category Kernel => Compiler
01-28-09 01:25 lewis Note Added: 0012936
01-30-09 03:16 wiz Note Added: 0012939
01-30-09 12:20 lewis Note Added: 0012940
02-02-09 22:01 wiz Note Added: 0012941
09-19-09 21:06 nicolas cellier Status new => resolved
09-19-09 21:06 nicolas cellier Fixed in Version  => 3.10.2bc
09-19-09 21:06 nicolas cellier Resolution open => fixed
09-19-09 21:06 nicolas cellier Assigned To  => nicolas cellier
09-19-09 21:06 nicolas cellier Note Added: 0013316
04-18-10 22:05 andreas Status resolved => closed


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