[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Accepting arbitrary strings as structure field names
From: |
Etienne Grossmann |
Subject: |
Re: Accepting arbitrary strings as structure field names |
Date: |
Sat, 4 Nov 2006 22:19:59 -0500 |
User-agent: |
Mutt/1.4.2.1i |
Hi all,
On Sat, Nov 04, 2006 at 09:40:38PM -0500, Bill Denney wrote:
# Rafael Laboissiere wrote:
# >Would it be acceptable to remove the restriction of structure field names
# >being valid_identifier? The benefit of this change is that Octave will
# >have
# >hash arrays for free, allowing code like this:
# >
# > var.("@#$%") = 0;
# >
# I'm guessing that this would be pretty hard to do. Is there a reason
would it? With a two-line patch (a check removal, more precisely, see
below), I can do:
octave:5> var.("@#$%") = 0;
octave:6> var
var =
{
@#$% = 0
}
Disclaimer: I didn't check for potential trouble brought by the patch.
Cheers,
Etienne
======================================================================
--- octave-2.9.9/src/pt-idx.cc 2006-06-16 05:09:42.000000000 +0000
+++ octave-2.9.9/src/pt-idx.cc.no_hash_field_check 2006-11-04
19:07:13.000000000 +0000
@@ -203,8 +203,8 @@
{
fn = t.string_value ();
- if (! valid_identifier (fn))
- ::error ("invalid structure field name");
+ // if (! valid_identifier (fn))
+ // ::error ("invalid structure field name");
}
}
else
======================================================================
# you couldn't restrict your hashing to use base 52 numbers and map them
# to [A-Za-z]?
# Bill
--
Etienne Grossmann ------ http://www.isr.ist.utl.pt/~etienne
- Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/04
- Re: Accepting arbitrary strings as structure field names, Bill Denney, 2006/11/04
- Re: Accepting arbitrary strings as structure field names,
Etienne Grossmann <=
- Re: Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/05
- Re: Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/05
- Re: Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/05
- Re: Accepting arbitrary strings as structure field names, John W. Eaton, 2006/11/10
- Re: Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/10
- Re: Accepting arbitrary strings as structure field names, John W. Eaton, 2006/11/10
- Re: Accepting arbitrary strings as structure field names, Rafael Laboissiere, 2006/11/11