[squeak-dev] Separator character in class names

Trygve Reenskaug trygver at ifi.uio.no
Thu Nov 20 19:25:13 UTC 2014


Many thanks. Sound good. I'll try it ASAP

The Squeak-dev list impressive. It has never failed me and has given 
answers within a few hours. (May be it was you who replied previously 
too, Eliot?)


On 20.11.2014 20:11, Eliot Miranda wrote:
> Hi Trygve,
>
> On Thu, Nov 20, 2014 at 9:32 AM, Trygve Reenskaug <trygver at ifi.uio.no 
> <mailto:trygver at ifi.uio.no>> wrote:
>
>     Hi,
>     I'm relying on decomposing composite class names.
>     An example class name is /BB5aBank/
>     I decompose it into /#(BB5a Bank)/ but am using ugly and
>     error-prone hacks to achieve it.
>     It would be very helpful if I could use some kind of separator in
>     the class name, e.g., /BB5a:Bank/
>
>     I've tried brute force by renaming class /BB5aBank /to /BB5a:Bank/
>     This is permitted and Smalltalk points to the renamed class.
>     Compiling a method that is using the new class name fails:
>     /bank := /Expression expected ->/BB5a:Bank new/
>
>     I've looked into the Parser code, but got lost.
>
>
> You probably need to dive down into the Scanner.  For example if you 
> used period and modified Scanner>>xLetter to not terminate the scan if 
> it sees a period followed by a capital letter you'll likely be able to 
> parse e.g. BB5a.Bank as a single token.  If you look at the xLetter 
> method you'll see it already tests self allowUnderscoreSelectors to 
> accept underscores.
>
> Ah, so an alternative would be to make sure the 
> allowUnderscoreSelecctors preference is set and use underscore as your 
> separator.
>
> HTH
>
>
>
>     Anybody have any ideas?
>
>     --Trygve
>
>
>
>
>
>
> -- 
> best,
> Eliot

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20141120/f81644fe/attachment.htm


More information about the Squeak-dev mailing list