develooper Front page | perl.fwp | Postings from March 2005

Re: Self-recognizing programs and regular expressions

Thread Previous
From:
Jasvir Nagra
Date:
March 7, 2005 16:24
Subject:
Re: Self-recognizing programs and regular expressions
Message ID:
1110241228.15517.78.camel@stoic
Nice!

In my first draft of the problem I had specifically disallowed
infinitely long strings (afterall "print "print "print ... is not a
valid quine) but I must have foolishly dropped it in one of the
revisions. 

I'll accept infinitely long solutions as soon as we have a cpan module
that allows infinitely long regex.  :)

On Mon, 2005-03-07 at 23:05 +0000, Ton Hospel wrote:
> Ah, the idea seems salvagable, but less elegant:
> 
> this sequence is self matching:
> ^
> ^\^
> ^\^\\\^
> ^\^\\\^\\\\\\\^
> ....
> 
> so an infinite sequence of ^ with 2**n-1 \ after the n-th ^
-- 
Jasvir Nagra
http://www.cs.auckland.ac.nz/~jas


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About