Am Donnerstag, 17. August 2006 08:24 schrieb Chip Salzenberg:
>
> The None class serves no useful (portable) purpose and it should be
> removed, especially from the public interface of Hash.

I've started fixing that. I'll do that in small steps, as there are some build 
and test errors. The main problem is related to code like:

  $P0 = hsh['no_such_key']
  # check type of $P0 against 'None'

or

  $P0 = hsh['no_such_key']
  if $P0 ...

The current only safe replacement is:

  $I0 = exist hsh['no_such_key']
  ...

This can *later* be optimized to:

  $P0 = hsh['no_such_key']
  ifnull $P0 / unless $P0 ...

A releated change:

  $S0 = hsh['no_such_key']

used to return an empty STRING*, it'll soon return a NULL STRING*. 

Folks, please check your usage of testing for existing hash keys.

NB: retrieving native {I,N} of non-existing keys is no problem, it will still 
return 0, 0.0.

leo

Reply via email to