[Pharo-users] Re: mapping CamelCase to

2022-10-26 Thread Richard O'Keefe
What's wrong with

$- join: (s cutCamelCase collect: [ :each | each asLowercase])

where s is the string you want to transform?
I'm sure you're aware of the proverb:
  You have a problem and you decide to solve it with
  a regular expression.  Now you have TWO problems.

MYWeirdName and MyWeirdName both map to my-weird-name,
but perhaps you are happy with that.

On Sat, 22 Oct 2022 at 21:57, Siemen Baader  wrote:

> Hi,
>
> I'm looking for an elegant way to convert class names with optional
> namespace prefixes to names for custom html elements.
>
> MYCustomElement and CustomElement
>
> to
>  and 
>
> There must be an elegant way to do it with regex or inject, but I'm
> embarrassed to say I can't get my head around it. I can get it to match the
> regex '((:isUppercase:+)*)((:isUppercase::isLowercase:+)*)', (if I recall
> correctly) but can't get a collection of the individual elements 'MY'
> 'Custom" 'Element' to lowercase and join.
>
> Thanks for any hints!
>
> cheers
> Siemen
>


[Pharo-users] Re: mapping CamelCase to

2022-10-26 Thread Richard O'Keefe
The important thing is that there is no NEED to write a
new method to split a Smalltalk identifier into pieces,
because there already *IS* such a method.

Only write a new method if the existing one doesn't actually
work for you.  For example, what do you want to be done with
strings or symbols that contain non-alphanumeric characters,
like #== ?  What do you want done with underscores and digits
in strings like 'INTL_61_123_456'?

On Wed, 26 Oct 2022 at 22:41, Richard O'Keefe  wrote:

> What's wrong with
>
> $- join: (s cutCamelCase collect: [ :each | each asLowercase])
>
> where s is the string you want to transform?
> I'm sure you're aware of the proverb:
>   You have a problem and you decide to solve it with
>   a regular expression.  Now you have TWO problems.
>
> MYWeirdName and MyWeirdName both map to my-weird-name,
> but perhaps you are happy with that.
>
> On Sat, 22 Oct 2022 at 21:57, Siemen Baader 
> wrote:
>
>> Hi,
>>
>> I'm looking for an elegant way to convert class names with optional
>> namespace prefixes to names for custom html elements.
>>
>> MYCustomElement and CustomElement
>>
>> to
>>  and 
>>
>> There must be an elegant way to do it with regex or inject, but I'm
>> embarrassed to say I can't get my head around it. I can get it to match the
>> regex '((:isUppercase:+)*)((:isUppercase::isLowercase:+)*)', (if I recall
>> correctly) but can't get a collection of the individual elements 'MY'
>> 'Custom" 'Element' to lowercase and join.
>>
>> Thanks for any hints!
>>
>> cheers
>> Siemen
>>
>


[Pharo-users] Re: mapping CamelCase to

2022-10-26 Thread Kasper Osterbye
> 
> What's wrong with
> 
> $- join: (s cutCamelCase collect: [ :each | each asLowercase])

There is no method called cutCamelCase in Pharo. If there was, this was exactly 
the right solution to use something existing.

Best,

Kasper




[Pharo-users] [Ann] Bloc v1.0

2022-10-26 Thread stephane ducasse
Hi all 

At ESUG and after about a year of development, the Pharo consortium was happy 
to announce 
a first version of the Bloc graphics framework as available in

https://github.com/pharo-graphics/bloc 


Here is the video of the ESUG presentation 

https://rmod-files.lille.inria.fr/Videos/2022-ESUG/Day2/2f-esug-v3.mp4

We are now opening the internal mailing-list and feel free to join. 
We will be soon describing the roadmap for the next 6 months. 

https://sympa.inria.fr/sympa/info/lse-bloc 



S

[Pharo-users] Re: [Ann] Bloc v1.0

2022-10-26 Thread Stéphane Ducasse


> On 26 Oct 2022, at 13:25, stephane ducasse  wrote:
> 
> Hi all 
> 
> At ESUG and after about a year of development, the Pharo consortium was happy 
> to announce 
> a first version of the Bloc graphics framework as available in
> 
>   https://github.com/pharo-graphics/bloc 
> 
> 
> Here is the video of the ESUG presentation 
> 
>   https://rmod-files.lille.inria.fr/Videos/2022-ESUG/Day2/2f-esug-v3.mp4 
> 
> 
> We are now opening the internal mailing-list and feel free to join. 
> We will be soon describing the roadmap for the next 6 months. 
> 
>   https://sympa.inria.fr/sympa/info/lse-bloc 
> 

In fact 

> https://sympa.inria.fr/sympa/info/lse-openbloc 
>