develooper Front page | perl.perl6.internals | Postings from July 2002


Brent Dax
July 14, 2002 12:02
Message ID:
Stephen Rawls:
#   I've only been involved with parrot since last week,
# but I've been learning quickly from all the
# documentation.  With the recent activity about lack of 
# documentation, I thought I'd try to help out as best I could. 
#  I've attached a file for an candidate. 
# Some parts may be wrong, and at some points I even ask 
# questions, but there isn't much to rx.[ch], so overall it 
# should be a decent rough draft.  Below are my questions, 
# copied right out of the attached document:
# 1) The rx_is_number_character function breaks the
# abstraction and uses the following expression to test
# the argument:
# if (ch >= '0' && ch <= '9')
# It explains that it is "faster to do
# less-than/greater-than"
# My question is: Doesn't this restrict the ability for
# adding different character encodings and languge
# support?  What about languages that don't use arabic
# numerals?

It's a speed hack.  I'm well aware that it won't work on some languages,
but I figured we can always change it later.

# 2) In the rxinfo struct:
# opcode_t *substfunc;
# My first guess was that that is a pointer to the first
# opcode the regex uses, but then I got confused by the
# name 'substfunc.'  So basically ... what is it used
# for?

It's unused; originally I was planning to have the regex engine handle
substitutions (and you would pass in a label to call to get the
replacement string), but I changed my mind.  Apparently that never

Overall, well done on the file--I think you explained bitmaps better
than I could have.  :^)

--Brent Dax <>
@roles=map {"Parrot $_"} qw(embedding regexen Configure)

He who fights and runs away wasted valuable running time with the
fighting. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About