REBOL3 tracker
  0.9.12 beta
Ticket #0001528 User: anonymous

Project:



rss
TypeBug Statuscomplete Date16-Mar-2010 23:34
Versionalpha 97 CategorySyntax Submitted byLadislav
PlatformAll Severityminor Prioritynormal

Summary 'self seems to be reserved in closures and funcs
Description Neither closures nor functions seem to be able to use 'self as an argument name. This means that USE in R3 cannot handle 'self as expected.
Example code
>> closure [self] []
** Script error: duplicate variable specified: self
** Where: make closure
** Near: make closure! copy/deep reduce [spec body]

>> func [self] []
** Script error: duplicate variable specified: self
** Where: make func
** Near: make function! copy/deep reduce [spec body]

>> use [self] ['self]
** Script error: duplicate variable specified: self
** Where: make use
** Near: make closure! reduce [to block! vars copy/deep body] []

Assigned ton/a Fixed inalpha 98 Last Update2-Nov-2010 00:51


Comments
(0002109)
BrianH
22-Mar-2010 23:19

Note that 'self is not bound in the code block even if not specified in the spec. The problem is that the spec doesn't allow self as an argument, and this could be a problem for people rolling their own OOP system based on different principles but using the same name, or who just want to use 'self. It's not a problem for those writing OOP code in REBOL style though.
(0002118)
BrianH
25-Mar-2010 00:52

This could be resolved by having MAKE closure! and MAKE function! not consider the hidden 'self field of their contexts when screening argument words for dups. This would make sense since that field is not used in the argument list when the function is called, so it isn't really a duplicate argument. And it is consistent with the hidden 'self not being bound in the code block.
(0002734)
Ladislav
1-Nov-2010 18:34

in the core-tests suite

Date User Field Action Change
2-Nov-2010 00:51 BrianH Status Modified tested => complete
1-Nov-2010 18:34 Ladislav Comment : 0002734 Added -
6-May-2010 08:21 BrianH Status Modified reviewed => tested
6-May-2010 08:21 BrianH Fixedin Modified => alpha 98
20-Apr-2010 08:45 Ladislav Priority Modified high => normal
20-Apr-2010 08:40 Ladislav Priority Modified normal => high
30-Mar-2010 11:07 Ladislav Comment : 0002158 Removed -
30-Mar-2010 11:06 Ladislav Comment : 0002158 Added -
25-Mar-2010 00:53 BrianH Status Modified submitted => reviewed
25-Mar-2010 00:53 BrianH Description Modified -
25-Mar-2010 00:52 BrianH Comment : 0002118 Added -
25-Mar-2010 00:48 BrianH Code Modified -
22-Mar-2010 23:19 BrianH Comment : 0002109 Added -
17-Mar-2010 07:52 Ladislav Type Modified Issue => Bug
17-Mar-2010 07:52 Ladislav Code Modified -
17-Mar-2010 07:52 Ladislav Description Modified -
16-Mar-2010 23:34 Ladislav Ticket Added -