Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Sun, 23 Sep 2012 07:58:11 +0400
From: Solar Designer <>
Subject: Re: Spaces ... in rules (was: Library for manipulating rules)

Frank -

Thank you for helping answer this!  It saved me time and probably also
helped Simon proceed with his project sooner.  I only have some minor

On Fri, Sep 21, 2012 at 12:04:13AM +0200, Frank Dittrich wrote:
> Looks like when adding extra spaces for better readability has been
> introduced, it has been taken care of to expect these additional spaces
> only in places where they cannot be mistaken as a part of an existing
> command.

Actually, it's been this way forever.  The spaces for readability are
just NOP commands, exactly the same as the : (colon) NOP command.  We
were not using them before 1.7.4 because they had performance cost.  We
started using them for readability when I introduced an optimization
pass in 1.7.4, squeezing all NOPs out (both spaces and colons).  This
optimization pass is indeed aware of what commands are available, so it
does not remove spaces and colons that are part of other commands.

> > Also, how to append " with the A command ?
> Ax"""x
> A~[ -z][ -z]~
> The only problem is if you want to append multiple arbitrary ascii
> characters, because the delimiters need to be different from the
> characters you want to insert.

doc/RULES talks about this:

AN"STR" insert string STR into the word at position N

To append a string, specify "z" for the position.  To prefix the word
with a string, specify "0" for the position.

Although the use of the double-quote character is good for readability,
you may use any other character not found in STR instead.  This is
particularly useful when STR contains the double-quote character.
There's no way to escape your quotation character of choice within a
string (preventing it from ending the string and the command), but you
may achieve the same effect by specifying multiple commands one after
another.  For example, if you choose to use the forward slash as your
quotation character, yet it happens to be found in a string and you
don't want to reconsider your choice, you may write "Az/yes/$/Az/no/",
which will append the string "yes/no".  Of course, it is simpler and
more efficient to use, say, "Az,yes/no," for the same effect.


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.