Re: How to develope wily?

  • From: Sam Holden <sholden@xxxxxxxxxxxxxx>
  • To: wilyfans@xxxxxxxxxxxxx
  • Date: Fri, 01 Oct 2004 20:09:55 +1000

"Ian Broster" writes:
>
>> Sorry for being unclear.  I meant the Edit command in acme
>> that takes sam commands and apply them to the buffer.
>
>Not at all, I haven't used acme/plan9 for too long!
>
>I use perl do do something similar. I have a program 's'
>which basically sed using the slightly more flexible perl
>regexps.

I do a similar thing except that the script is $SHELL so
B2ing |s/foo/bar/g "works" - for my definition of works :)

>
>I frequently use, e.g.
>
>||s 's/hello/good bye/g;s/yes/no/i'

Mmm... My $SHELL doesn't handle multiple commands in one
go like that...

>
>the double pipe is a modification I made that
>means pipe the whole buffer i.e. :, then |
>
>the argument can include arbitrary perl code of course,
>it doesn't have to be a regexp, the code is executed once
>per line.

Is the script perhaps:

#!perl -pe
# and that's all folks

:)

>
>Why cannot Edit be written like this?
>
>#!/usr/bin/perl -w
>my $reg=shift;
>
>eval "
>while (<>) { $reg;print;}
>"

Doesn't sam support those wonderous "structured regular expressions"?
Which let you define "lines" a tad more flexibly.

-- 
Sam Holden



Other related posts: