9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: smiley@icebubble.org
To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net>
Subject: Re: [9fans] anchors broken in the g command in sam on p9p?
Date: Thu, 22 Aug 2013 17:03:52 +0000	[thread overview]
Message-ID: <86vc2xk687.fsf@cmarib.ramside> (raw)
In-Reply-To: <86mwobarmx.fsf@cmarib.ramside> (smiley@icebubble.org's message of "Wed, 21 Aug 2013 17:19:18 +0000")

Well, I finally figured it out: how to use sam for Real Life Work(TM)!
It took me about 8 hours to figure out, but I finally managed to create
my first practical sam script.  I just kind of pulled a Buddha, you
know, "I will not move from this spot until I can program sam!"  ;)

Far from being mystical, however, the experience was reminiscent of
coding in Scheme.  You have to kind of think of some things backwards,
and the code ends up looking all but unreadable.  In fact, sam is
probably LESS readable than Scheme, because all its commands are single
letters, and it doesn't have any syntax for comments.

The script ended up being 1722 bytes long, occupying 50 lines.  It's not
perfect; it's not even elegant; but it gets the job done.  While I did
not reach enlightenment, I did end up with a script that can convert a
(very poorly-formatted) HTML page into reStructuredText.  And it just
might have made me just as happy.  :)

--
+---------------------------------------------------------------+
|Smiley       <smiley@icebubble.org>    PGP key ID:    BC549F8B |
|Fingerprint: 9329 DB4A 30F5 6EDA D2BA  3489 DAB7 555A BC54 9F8B|
+---------------------------------------------------------------+



  parent reply	other threads:[~2013-08-22 17:03 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-21  5:11 smiley
2013-08-21  6:45 ` Rob Pike
2013-08-21 17:19   ` smiley
2013-08-22  6:24     ` Rudolf Sykora
2013-08-22  9:35       ` Rob Pike
2013-08-22 17:03     ` smiley [this message]
2013-08-25  7:58       ` Erez Schatz
2013-09-02  0:52         ` smiley
2013-08-21 20:14 ` Rudolf Sykora
2013-08-21 20:23   ` Rudolf Sykora

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86vc2xk687.fsf@cmarib.ramside \
    --to=smiley@icebubble.org \
    --cc=9fans@9fans.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).