[Top][All Lists]

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

Re: Adding stuff to the core distro (was Re: Infix syntax)

From: Daniel Skarda
Subject: Re: Adding stuff to the core distro (was Re: Infix syntax)
Date: 20 Oct 2002 21:05:10 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

> On Wed, Oct 16, 2002 at 11:35:15PM +0200, Daniel Skarda wrote:
> > ps: Sometimes I also use read-hash extension for shorter
> > (sed|awk|perl|...)-like regular expressions: #/foo.*bar/i, sometimes
> > I also use srfi-10 #,(rx "foo.*bar" icase). Do you think that other
> > guilers would benefit from such hairy extensions?
> Ack. I actually started using #/ for SQL.

  Oops :-) How do you use it for SQL?

  I usually do not support adding new syntactic sugar to Scheme, but
sometimes I simply can not resist :-)

  I picked up #/regexp/ since almost all programmers are familiar with
similar syntax from perl, awk, sed and other shell utils. 

  The advantage of this style of writing regexps is its "regexpness" :-) 
and the ability to create regexp during read (no need to "toplevel" define
etc). The later can also be achieved by #,(rx "regexp"), which is more
schemish but less regexpish, it is longer and you have to write two escapes
instead of one (definitely not tempting features for lazy programmers :-).

  As I wrote in another email I would like to add lisp-like readtables to
Guile read so it would be possible to make read-hash-extension per-module.

  IMHO Guile should come with modules that implement/activate syntax
extensions (like infix syntax, #/regexps/, #,(rx "regexp") or whatever),
if we preserve following rules:

  1) extensions are off by default

  2) no Guile code (srfi,ice-9) use or depends on these extensions.

  3) user is clearly warned that these extensions are not portable 

  4) one extensions does not clash with another...

  Maybe we also should pick some policy to prevent future clashes
(#/regexps/ versus your #/ in SQL)


reply via email to

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