perlhash.pod says:

"""
TODO: Steve Fink sayd:

  And if there were a keys() method, then 'defined' and 'exists' are
  very different. (And there ought to be, and would be if we weren't
  all ignoring Leo's iterator proposal.)

I need to read that proposal :-)
"""

Looks like the proposal got accepted? I see iterator.c and 
read the recorresponding tests... I went ahead and used it. 
Is that cool?

 
    # s is a PerlHash
    dict:
        unless s goto empty
            .local object iter
            .local object key
            .local object val
            .local string skey
            key = new PerlString

            print "{"
            iter = new Iterator, s
            iter = 0  # reset it
            unless iter goto enddict
                shift skey, iter
                key = skey
                .arg 1
                .arg key
                call __py__print
                print ": "
                val = s[skey]
                .arg 1
                .arg val
                call __py__print
            enddict:
               print "}"
        empty:
            print "{}"
        goto done


Sincerely,
 
Michal J Wallace
Sabren Enterprises, Inc.
-------------------------------------
contact: [EMAIL PROTECTED]
hosting: http://www.cornerhost.com/
my site: http://www.withoutane.com/
--------------------------------------


Reply via email to