> Since I really like the idea of typed field values, and find Lee's arguments > rather clumsy themselves, i want to give an example where typing would be > needed:
Thanks, I like examples. > Suppose you have a field named storable.publicationyear . Now the node can > *by definition* not know what type this field is, as all the storable > fields contain metadata which is processed by the clients. The field's type is "Storable.PublicationYear". What you want to do is say that it and other such fields are encoded in a standard small set of ways, such as decimal integers, dates, etc. > Now suppose we agree on some search proposal or another. Suppose this > search proposal allows a further limitation on the results of the search > by using (a) search string(s) to match against the metadata. > Now suppose a client sends a searchstring "publicationyear > 1967" > which is supposed to narrow down the search results to those that > have a storable.publicationyear value greater than 1967. Now the node > _needs_ to know that the field storable.publicationyear contains a > numeric value to do a numeric comparison. > So that's why we _need_ typed fields. Actually, that's a good argument--thanks again for finally finding one I understand. We don't _need_ them really, but being able to compare values for searches is indeed a useful function of weak typing, because it allows comparisons to specified more simply. Without weak typing, it could still be done by allowing the comparator to specify the type: "dateCompare(Storable.PublicationDate,today) < 1" or something. In this particular case, I'd rather have a common "Date" type that serveral fields could share, encoded in an ISO standard format that is easily comparable (e.g. "2000-05-15 13:01:54", UTC only). How about this compromise: We define a small set of "encodings" for fields, that can be used for operations like comparison and whatever Oskar and Scott have in mind (which I still don't quite understand). But the spec makes it clear that name==type, and all applications are forbidden to modify, delete, or add fields based on nothing but these encodings, and that these encodings must all be representable and fully transportable as strings, so that applications treating them as such will not lose information. Every field's purpose is defined totally and exclusively by its name, and only one encoding is allowed for any defined type. -- Lee Daniel Crocker <lee at piclab.com> <http://www.piclab.com/lee/> "All inventions or works of authorship original to me, herein and past, are placed irrevocably in the public domain, and may be used or modified for any purpose, without permission, attribution, or notification."--LDC _______________________________________________ Freenet-dev mailing list Freenet-dev at lists.sourceforge.net http://lists.sourceforge.net/mailman/listinfo/freenet-dev
