chicken-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-hackers] substring function and bounds checks


From: John Cowan
Subject: Re: [Chicken-hackers] substring function and bounds checks
Date: Thu, 7 Feb 2013 21:50:20 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

Alex Shinn scripsit:

> This is where you have a contradiction - the field is "fixed width"
> but the full width is not available, which means you have an invalid
> format.

Yes, in one sense.  However, when transferring textual data between
heterogeneous systems it is very common for trailing spaces to be
discarded willy-nilly, and the approach described recovers from that
nicely.  Be liberal in what you accept.

> If the goal is to take a fixed field you should be taking that.  If
> the format allows either then the format itself is ambiguous, which
> means you have a _much_ bigger problem than whatever language
> idioms you use.

Purism has its place, but is not always the appropriate response
to Real World issues.  In this case, kicking back such records
as "invalid/ambiguous format" simply would not have served the
organization's goals.

-- 
In my last lifetime,                            John Cowan
I believed in reincarnation;                    http://www.ccil.org/~cowan
in this lifetime,                               address@hidden
I don't.  --Thiagi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]