Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Artyom Bologov
@aartaka@merveilles.town  ·  activity timestamp 2 weeks ago

Y'all, I created an #ed(1) monster:

!echo "HELLO" > hello.txt
E hello.txt
p
s/.*/p\
s|.*|p\\\
s;.*;p\\\\\\\
Q\\\\\\\
;\\\
,w !ed %\\\
Q\\\
|\
,w !ed %\
Q\
/
,w !ed %
Q

It's a script that
- Prints contents of a file, then
- Rewrites them to a script that
- Prints contents of a file, and then
- Rewrites them to a scripts that
- Prints contents of a file, and then
- Rewrites them to a script that
- Prints the contents of a file
- And then exits.

And who said that metaprogramming is not possible outside #Lisp? (No one, actually.)

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0-rc.3.21 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login