Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: BASIC hajp

by BooK (Curate)
on Jan 19, 2001 at 00:50 UTC ( #52834=note: print w/ replies, xml ) Need Help??


in reply to BASIC hajp

Basically, you wrote it so BASIC_COMMENT is PERL_CODE while BASIC_CODE is PERL_COMMENT... Both parts are distinct: remove the Perl code and the BASIC works pretty well.

This is the first step into polyglots, but don't stop here.

Next, you can try using the variable q$ in BASIC, which will allow you to hide a little BASIC into a Perl quoted-string... Then you begin to intermix the two languages. That is where the real fun part begins.

Until you reach a point where every part of the code is essential. When you're stuck with your code, and it's just... beautyful. Like a work by M. C. Escher.

Of all aspects of writing polyglots, this is the best, ever... (soooorry, couldn't help)


Comment on Re: BASIC hajp
Re: Re: BASIC hajp
by kschwab (Priest) on Jan 19, 2001 at 01:02 UTC
    Well, sort of. The BASIC can stand alone, but the Perl is something of a fragile/one-off/single purpose BASIC interpreter. So, the BASIC works without the Perl, but the Perl doesn't work without the BASIC.

    I like the q$ idea...perhaps I can get more than 1/2 a polyglot next time.

    Thanks for the feedback...

    Update: I added something a bit closer to a polygot on the original node. Thanks BooK !

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://52834]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2014-11-28 00:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My preferred Perl binaries come from:














    Results (191 votes), past polls