[TxMt] An alternate stracc (objc bundle) implementation snippet

Mark Grimes mark at stateful.net
Thu Apr 13 00:20:54 UTC 2006


On Apr 12, 2006, at 4:19 PM, Allan Odgaard wrote:

> On 12/4/2006, at 23:37, Mark Grimes wrote:
>
>> [...] Clearly fThing is not defined so return fThing makes no  
>> sense in a getter accessor method.  Nor does instantiating another  
>> string object in the setter method.
>
> As for fThing, I have no idea. I guess f is a prefix to signal  
> “instance variable.” I don’t see anything new instantiated in the  
> setter though. It makes a copy of the ivar pointer, copies the new  
> value to the ivar, and the releases the old ivar via the copied  
> pointer.

This brings to question other accessor snippets.  Take scalars for  
instance:

- (${1:unsigned int})${2:thing}
{
	return ${3:fThing};
}

- (void)set${2/./\u$0/}:(${1:unsigned int})new${2/./\u$0/}
{
	${3:fThing} = new${2/./\u$0/};
}

Clearly this fThing is a problem... a simple insert and recompile  
generates errors and warnings.
Does anyone on the list know why this is there, and if it is a  
shortcut to some prefix voodoo, why doesn't it just work as-is?  I'm  
inclined to want to change this as well.

(On a side note: Mmmmmm CoreData accessor... woot bbum!)

--
Mark Grimes
Stateful Labs
mark at stateful.net


-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 186 bytes
Desc: This is a digitally signed message part
URL: <http://lists.macromates.com/textmate/attachments/20060412/57aaad68/attachment.sig>


More information about the textmate mailing list