bug-apl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-apl] Regex support


From: Elias Mårtenson
Subject: Re: [Bug-apl] Regex support
Date: Thu, 21 Sep 2017 18:09:19 +0800

I've implemented the bare minimal needed to get regexes working through a ⎕RE function. I've attached the diff.

I really need Jürgen to take a look at this, since my code that constructs the return value cannot possibly be correct. There must be a better way to handle this which does not involve conversion back and forth between std::string.

Also, I have the result in an UTF-8-encoded C string, and I try to create an UTF8_string from it like this:

    Value_P field_value(UTF8_string(field.c_str()), LOC);

However, when I test this in APL I get the following result:

      '(..)..(..)$' ⎕RE 'sdklfjfj⍉'
┏→━━━━━━━━━━┓
┃"lf" "jâ\215\211"┃
┗∊━━━━━━━━━━┛

It seems the UTF-8 conversion is not done correctly by the UTF8_string constructor. What did I do wrong?

Regards,
Elias      

On 21 September 2017 at 11:38, Xiao-Yong Jin <address@hidden> wrote:

> On Sep 20, 2017, at 9:19 PM, Peter Teeson <address@hidden> wrote:
>
> (These days performance can hardly be a compelling argument
> with multiple many-core CPU chips.)

This kind of argument for APL is exactly why Fortran is still alive and well.


Attachment: regexp.diff
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]