glenn wrote:
As you suggest, this is used a lot in error handlers and other places, especially in the face of internationalization.
I don't think it's a huge project to create this functionality in Squeak, and while you can't steal the VW code, I think we'd benefit from having compatible syntax, so I'd encourage you or some other Squeaker to check out the VW description.
It's usually used like in [self error:"No object at offset %i !",offset] in Objective C.
Talking about error handling, I've renamed our -ifException: to be like Squeak's -ifError: to be compatible.
glenn wrote: > > As you suggest, this is used a lot in error handlers and other > places, especially in the face of internationalization. > > I don't think it's a huge project to create this functionality > in Squeak, and while you can't steal the VW code, I think we'd > benefit from having compatible syntax, so I'd encourage you or > some other Squeaker to check out the VW description.
It's usually used like in [self error:"No object at offset %i!",offset] in Objective C.
Talking about error handling, I've renamed our -ifException: to be like Squeak's -ifError: to be compatible.
The neat thing about glenn's example, which does not appear to be in the ObjC example, above, is the "naming" of the substitution arguments and the availability of a conditional expression in the pattern string. Naming allows the same substitution to be mentioned more than once and out of order in the pattern, and conditionals have their own utility, as in glenn's example.
(Another source of inspiration may be the Common Lisp "format" feature, which is even more elaborate. Or perhaps Ken Dickey can post a blurb about his more modest format feature he developed for Scheme. 8^)
<x-rich><nofill> Is anyone working on a Smalltalk to Objective-C interface? I don't mean code conversion, I mean a direct interface between running Smalltalk and Objective-C code.
Steve
</nofill>
</x-rich>
squeak-dev@lists.squeakfoundation.org