Do we really have to choose? I'd prefer to have a library with native
methods
(c), which would allow for procedural-style coding (and could be replicated
by non-oo implementations of ooRexx), *and* (a or b, I don't care much)
a oo-based implementation.

Like ooSQLite.

So that if one day (say) Regina implemented utf8proc, one could write
a Rexx script that would be really portable.

BTW: Thanks for your work!

  Josep Maria

Missatge de Gilbert Barmwater via Oorexx-devel <
[email protected]> del dia dg., 7 de juny 2026 a les 20:12:

> At first glance, I think I prefer option b).  The downside I see is the
> added size to the overall interpreter for scripts that don't use Unicode.
> I believe that impact is not significant enough that we should require
> specific user actions when one needs Unicode in their script.
>
> Gil
> On 6/7/2026 12:37 PM, Jean Louis Faucher wrote:
>
> The interpreter has direct access to utf8proc if needed, so the type of
> wrapper has no impact.
>
> What is the best way to provide access to utf8proc from a script?
> Some of the methods are REXX methods, mainly for the constants.
> The remaining methods are native (20 methods).
>
> a)
> Native class UTF8Proc with class methods only.
> No instances, enforced by New and Copy.
> UTF8Proc.cls is included in rexx.img.
> It works, but there is no similar implementation among the predefined
> classes.
>
> b)
> Native class UTF8Proc with instance methods.
> Singleton, similar to RexxInfo.
> UTF8Proc.cls is included in rexx.img.
>
> c)
> Not a native class, but a library with native methods, similar to File or
> Stream.
> Singleton.
> UTF8Proc.cls is included in rexx.img.
>
> d)
> Same as (c), but not included in rexx.img.
> UTF8Proc.cls is located in trunk/extensions/Unicode and must be loaded by
> the user.
>
>
> Illustration of the current implementation (option a):
>
> StartClassDefinition(UTF8Proc)
>
>         AddClassMethod("New"                        , UTF8ProcClass::newRexx,
> A_COUNT);
>         AddClassMethod("Version"                    , UTF8ProcClass::version,
> 0);
>         AddClassMethod("GraphemeBreak"              , 
> UTF8ProcClass::graphemeBreak,
> 1);
>         AddClassMethod("CodepointCategory"          , 
> UTF8ProcClass::codepointCategory,
> 1);
>         ...
>
>     CompleteClassMethodDefinitions();
>
>         AddMethod("Copy"                            , UTF8ProcClass::copyRexx,
> 0);
>
>     CompleteMethodDefinitions();
>
>     CompleteClassDefinition(UTF8Proc);
>
> EndClassDefinition(UTF8Proc);
>
>
>
>
> UTF8Proc.cls
> ...
> -- Values returned by .UTF8Proc~CodepointCategory(codepoint)
> ::constant CATEGORY_CN  0 /**< Other, not assigned */
> ::constant CATEGORY_LU  1 /**< Letter, uppercase */
> ::constant CATEGORY_LL  2 /**< Letter, lowercase */
> ::constant CATEGORY_LT  3 /**< Letter, titlecase */
> ::constant CATEGORY_LM  4 /**< Letter, modifier */
> ...
>
>
>
>
> _______________________________________________
> Oorexx-devel mailing 
> [email protected]https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
> --
> Gil Barmwater
>
> _______________________________________________
> Oorexx-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to