Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: Strings - takers wanted

2 views
Skip to first unread message

Aldo Calpini

unread,
Mar 11, 2005, 11:08:22 AM3/11/05
to perl6-i...@perl.org
Leopold Toetsch wrote:
> 1) ICU should be optional
>
> If configured --without-icu the Makefile shouldn't contain ICU stuff,
> and function calls to ICU (mainly in string_primitives) should be
> wrapped inside #if PARROT_HAS_ICU.

I'm gonna take this one (unless Steven Schubiger is already working on it).

just as a generic hint, what should the #else (eg when PARROT_HAS_ICU is
not defined) do?

a) consider everything ASCII and use the corresponding stdlib function
b) always return NULL (or some approximation of NULL)
c) complain to STDERR about ICU not being there
d) coredump

cheers,
Aldo

Leopold Toetsch

unread,
Mar 12, 2005, 11:59:32 AM3/12/05
to Aldo Calpini, perl6-i...@perl.org
Aldo Calpini <da...@perl.it> wrote:
> Leopold Toetsch wrote:
> > 1) ICU should be optional
> >
> > If configured --without-icu the Makefile shouldn't contain ICU stuff,
> > and function calls to ICU (mainly in string_primitives) should be
> > wrapped inside #if PARROT_HAS_ICU.

> I'm gonna take this one (unless Steven Schubiger is already working on it).

Great, thanks.

> just as a generic hint, what should the #else (eg when PARROT_HAS_ICU is
> not defined) do?

The opcodes, I've implemented, call the interface functions
Parrot_string_is_xxx, which take a string and an offset. ASCII and
iso-8859-1 can be handled by the internal functions. For unicode strings
the functions in charset/unicode.c should eventually call into unicode
library functions, that can be ICU or any other lib, we have an
interface for.

The current Parrot_char_is_xx functions are misnamed. These are ICU
interface functions. We should eventually rename string_primitives.c to
string_icu.c - I think.

We have:

opcodes -> interface -> implementation
Parrot_string_is_xxxx charset/*.c

The functions in charset/unicode.c then should call ICU interface
functions or whatever, if available.

> a) consider everything ASCII and use the corresponding stdlib function
> b) always return NULL (or some approximation of NULL)
> c) complain to STDERR about ICU not being there
> d) coredump

e) throw a real_exception

> cheers,
> Aldo

leo

0 new messages