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

2013-02-07 Thread Michele La Monaca
On Fri, Feb 8, 2013 at 5:43 AM, Alex Shinn wrote: > operations. The only example provided was fairly obscure and it was > indeed a composition, even if you don't think it's worth separating them > for logging or other handling. At the prompt of your shell type: # ls ?a_well_thought_out_substrin

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 4:21 PM, Michele La Monaca < mikele.chic...@lamonaca.net> wrote: > On Fri, Feb 8, 2013 at 5:43 AM, Alex Shinn wrote: > > operations. The only example provided was fairly obscure and it was > > indeed a composition, even if you don't think it's worth separating them > > for

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 12:26 PM, John Cowan wrote: > Alex Shinn scripsit: > > > The warning is important, and this again emphasizes that there > > are two _unrelated_ functions - extraction and truncation - and > > that combining them is a bad idea. > > The warning is important -- when it's impor

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

2013-02-07 Thread John Cowan
Alex Shinn scripsit: > The warning is important, and this again emphasizes that there > are two _unrelated_ functions - extraction and truncation - and > that combining them is a bad idea. The warning is important -- when it's important. In my case, it was important to avoid cluttering the excep

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 11:50 AM, John Cowan wrote: > Alex Shinn scripsit: > > > 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

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

2013-02-07 Thread John Cowan
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 spac

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 10:45 AM, John Cowan wrote: > Alex Shinn scripsit: > > > Can you provide a real-world example where you'd want to use this > > function? > > I used to use it all the time in Perl, where it is the normal behavior > of the substr() function, to pull a fixed-width field out of

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

2013-02-07 Thread John Cowan
Alex Shinn scripsit: > Can you provide a real-world example where you'd want to use this > function? I used to use it all the time in Perl, where it is the normal behavior of the substr() function, to pull a fixed-width field out of a line of text without having to worry about short lines. If th

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 10:14 AM, Michele La Monaca < mikele.chic...@lamonaca.net> wrote: > > "starting from a certain position give me chars up to the Nth position > or up to the end of the string whatever the first" > Can you provide a real-world example where you'd want to use this function? -

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

2013-02-07 Thread Michele La Monaca
How strange, I thought no one was interested in the discussion. Anyway, with John's permission just a few inline clarifications. On Thu, Feb 7, 2013 at 11:59 PM, Alex Shinn wrote: > > [...] > You didn't use it just to simplify, because the task > you described in English was "give me at most N ch

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

2013-02-07 Thread Alex Shinn
On Fri, Feb 8, 2013 at 2:23 AM, Michele La Monaca < mikele.chic...@lamonaca.net> wrote: > On Thu, Feb 7, 2013 at 12:20 AM, Alex Shinn wrote: > > Hi, > > > > On Thu, Feb 7, 2013 at 3:20 AM, Michele La Monaca > > wrote: > >> > >> [..] I don't think > >> > >> (substring2 "foo" 0 10) -> "foo" > >> >

Re: [Chicken-hackers] [PATCH] A cache system for the build environment

2013-02-07 Thread Michele La Monaca
On Thu, Feb 7, 2013 at 4:55 AM, Jim Ursetto wrote: > > This is how I do it. This way you have unlimited variants, can > recall any of them, and can optionally set a default. Also > it doesn't need a patch. > > echo 'make PREFIX=/tmp PLATFORM=macosx "$@"' > make.test > echo 'make PREFIX=/us

Re: [Chicken-hackers] [PATCH] Small improvement for the inline egg

2013-02-07 Thread Moritz Heidkamp
Hello again, Moritz Heidkamp writes: > 1. It dumps compilation results in ~/.cache by default. This, however, >is a bit like dumping stuff in /usr/share so I think it would be >better to make this ~/.cache/chicken-inline or something. Mario just pointed out to me in #chicken that the cur

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

2013-02-07 Thread Michele La Monaca
On Thu, Feb 7, 2013 at 7:35 PM, John Cowan wrote: > Michele La Monaca scripsit: > >> Well, no. I was looking for a python-like substring function. > > If that's all you really wanted, the slice egg (to which you have already > been referred; docs at ) does >

[Chicken-hackers] [PATCH] Small improvement for the inline egg

2013-02-07 Thread Moritz Heidkamp
Fellow Chickeneers, thanks to Felix mentioning it yesterday, I checked out the inline egg today. I think it's really neat, I recommend you to check it out, too, if you didn't, yet. I only noticed two things: 1. It dumps compilation results in ~/.cache by default. This, however, is a bit like d

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

2013-02-07 Thread John Cowan
Michele La Monaca scripsit: > Well, no. I was looking for a python-like substring function. If that's all you really wanted, the slice egg (to which you have already been referred; docs at ) does everything you are asking for, negative and past-the-end ind

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

2013-02-07 Thread Michele La Monaca
On Wed, Feb 6, 2013 at 12:47 AM, Felix wrote: >> # perl -e 'print substr("ciao",0,10);' >> ciao >> # ruby -e 'puts "ciao"[0..10]' >> ciao >> # python -c 'print "ciao"[0:10];' >> ciao >> # csi -e '(print (substring "ciao" 0 10))' >> Error: (substring) out of range 0 10 >> >> Call history: >

Re: [Chicken-hackers] [PATCH] file=? function to compare two files

2013-02-07 Thread John Cowan
Michele La Monaca scripsit: > > In any case, st_ino is garbage on Windows systems (other than Cygwin). > > Are you implicitly saying that I have to force the byte-by-byte > comparison in Windows? I don't know enough about Windows to say that. I'm only saying what will *not* work, because st_ino

Re: [Chicken-hackers] [PATCH] file=? function to compare two files

2013-02-07 Thread Michele La Monaca
On Fri, Jan 25, 2013 at 5:32 PM, John Cowan wrote: > Michele La Monaca scripsit: > >> I wasn't able to spot this kind of function in the library so I wrote >> it myself. Not sure if files.scm is the right place for that. Not sure >> either if inode-numbers equality in Windows is enough to state th

Re: [Chicken-hackers] [PATCH] file=? function to compare two files

2013-02-07 Thread Michele La Monaca
On Fri, Jan 25, 2013 at 6:36 PM, Christian Kellermann wrote: > * John Cowan [130125 17:33]: >> Michele La Monaca scripsit: >> >> > I wasn't able to spot this kind of function in the library so I wrote >> > it myself. Not sure if files.scm is the right place for that. Not sure >> > either if inode

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

2013-02-07 Thread Michele La Monaca
On Thu, Feb 7, 2013 at 12:20 AM, Alex Shinn wrote: > Hi, > > On Thu, Feb 7, 2013 at 3:20 AM, Michele La Monaca > wrote: >> >> [..] I don't think >> >> (substring2 "foo" 0 10) -> "foo" >> >> is conceptually wrong or sloppy as long as you know exactly what the >> semantic of the function is ("give

Re: [Chicken-hackers] [PATCH] platform auto-detection mechanism

2013-02-07 Thread Michele La Monaca
On Sun, Feb 3, 2013 at 10:02 PM, John Cowan wrote: > Michele La Monaca scripsit: > >> Incidentally a good reason not to rely on gcc to detect the platform. > > No autodetection will ever work with MSVC, for one might have both > that and mingw installed in the same path. Yes, sure. No autodetecti

Re: [Chicken-hackers] [PATCH] do not apply PROGRAM_PREFIX/PROGRAM_SUFFIX to target include directory in a cross-chicken build

2013-02-07 Thread Christian Kellermann
* felix winkelmann [130206 22:46]: > The attached patch removes the use of PROGRAM_PREFIX and > PROGRAM_SUFFIX in the include-directory name for the target "dev" > installation in a cross-chicken build. Thanks, I have pushed this. -- In the world, there is nothing more submissive and weak tha

Re: [Chicken-hackers] [PATCH] Apply the same naming scheme for .so libs in "libs" target

2013-02-07 Thread Christian Kellermann
* felix winkelmann [130204 21:29]: > >> I'm not sure about this. I know that the current behaviour is not > >> fully correct, but I repeatedly had problems the other way round, I > >> think mostly in the situation when I ran freshly built binaries in the > >> current build-directory, without insta