[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-hackers] substring function and bounds checks
From: |
.alyn.post. |
Subject: |
Re: [Chicken-hackers] substring function and bounds checks |
Date: |
Tue, 5 Feb 2013 20:40:49 -0701 |
On Wed, Feb 06, 2013 at 12:10:09AM +0100, Moritz Heidkamp wrote:
> Hi Michele,
>
> Michele La Monaca <address@hidden> writes:
>
> > Maybe this is not the right list for that, sorry.
>
> yeah, this one probably better fits chicken-users as it's not really
> about Chicken's implementation, so you might be losing some broader
> audience by posting it here. No problemo, though!
>
>
> > In fact, it makes the usage of substring "unsafe" and the
> > countermeasures I can imagine (manual bounds checks, padding, writing
> > my-own-substring-function, whatever) are quite unsatisfactory... to me
> > at least.
>
> I felt the same when coming to Scheme (from Ruby in my case). But after
> having been immersed in the langauge and community surrounding it for a
> while now I came to see it in a different light: What might look like
> impracticality at the beginning turns out to be a virtue in its own
> right. All languages you cite (well, apart from Python perhaps, as Peter
> noted) are from the DWIM-most-of-the-time spectrum which give a lot of
> leeway. This often leads to what Olin Shivers vividly describes as 80%
> solutions in the preamble of the SRE announcement (see
> http://www.scsh.net/docu/post/sre.html). I recommend you to read that
> one if you don't already know it. Scheme as a whole tries to aim for the
> 100% solutions (whether it's successful in that endeavor is open for
> debate, of course). That's why you'll often see functions reduced to
> their bare minimum purpose and correct behavior even in edge cases. This
> is especially true for functions defined in the standard core such as
> the one you are referring to. The nice thing is that from that solid
> core as a foundation we can build libraries which allow us to be a bit
> more sloppy when we want to whereas it's much harder to go the other way
> around.
>
> It may sound a bit like "just drink the Kool-Aid" but what I'm trying to
> say is: Scheme, as any language, has its own culture and you will be
> much happier when you try to embrace it rather than trying to impose
> concepts from other languages on it. But you probably already know this,
> so I hope my comment on the specific case of your substring issue is of
> help, anyway :-)
>
>
> Moritz
>
I certainly appreciate this design principle, but there is just no
explaining DSSSL using the above philosophy. I find the interaction
between #!rest and #!key much more sensible in Python, which forbids
every potentially ambiguous case and therefor has much more
consistent behavior with the various combinations available.
-Alan
--
my personal website: http://c0redump.org/
Re: [Chicken-hackers] substring function and bounds checks, Moritz Heidkamp, 2013/02/05
- Re: [Chicken-hackers] substring function and bounds checks,
.alyn.post. <=
Re: [Chicken-hackers] substring function and bounds checks, Felix, 2013/02/05
Re: [Chicken-hackers] substring function and bounds checks, Jim Ursetto, 2013/02/05