ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> perl6-internals
perl6-internals
Re: search_lex (again)...
by Leopold Toetsch other posts by this author
Aug 19 2003 3:20PM messages near this date
Continuations and COWed stacks (was: search_lex (again)...) | [perl #23411] [PATCH] Add drafty ABSTRACT and OVERVIEW to docs/strings.pod
Jos Visser <josv@[...].nl>  wrote:

>  Hi all,


>  In my case my "problem" (challenge) is that I want to generate some

>  parrot code that is capable of searching the lexical pads for the

>  existence of a lexical. In my particular case this code executes

>  frequently.


I would implement the proposed OrderedHash (HashArray) PMC, base
lexicals on these and then iterate over these aggregates in the lexical
pad. Trying to search for non existent lexicals doesn't seem to be a
good idea.

>  My current code generator generates code to trap the LEX_NOT_FOUND

>  exception. However, the "set_eh" instruction is *terribly* slow...


The C<set_eh>  is a stack_push and shouldn't be that slow. But your are

right. Something is fishy here. I'll try to find int.

>  I hacked around var.ops a bit to introduce a set of ops called

>  'search_lex' which just return a null PMC if the lexical is not found


While I'm not strictly against these, a new C<error>  flag (like the

current C<warns> ) in the interpreter->ctx to toggle some exception would

be better.

>  ++Jos.nl


leo


Thread:
Jos Visser
Leopold Toetsch
Leopold Toetsch

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved