Here is a very simple (and simple minded) grep program. The idea being to apply 
a Unicon regexp pattern to a series of files, just like grep

procedure main(args)
        local f, line, re := pop(args)

        every f := open(!args, "r") do {
                every line := !f do {
                        if line ?? re then write(line)
                }
        }
end

Of course, it doesn’t work because in line 6  I have a string instead of a 
pattern.

Is there any way to convert the contents of re from a string to a pattern?

After reading UTR18 again (and again), I’ve come to the conclusion that there 
isn’t any way to do it. 
The pertinent extract from UTR18 is in section 4.5.3 "Limitations due to lack 
of eval()”.
But before I give up on the idea entirely, I thought I’d check to see if my 
understanding is correct.

Don
------------------------------------------------------------------------------
_______________________________________________
Unicon-group mailing list
Unicon-group@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to