[Boulder.pm] Queue (FIFO)

Peter Hutnick pm at hutnick.com
Tue Jul 6 10:54:59 CDT 2004


You may remember that I was writing a script to convert LaTeX to HTML. 
You may also remember that I was using a gaggle of regex replacements to 
do it.  You probably thought that it was a bad idea.  And you were 
probably right.

So now I am thinking on rewriting it.  My current thinking is to 
tokenize it into LaTeX tags and blocks of text within those tags.  I 
have to face some difficult realities of LaTeX syntax, but I am 
confident that I can overcome the problems.

Anyway, I want to push those tokens into a queue (or FIFO, as you like). 
  Then "pop" them back off, do some magic, and write them to my HTML 
output file.  Of course, push and pop won't do this, as I understand it.

I've seen examples using push and unshift.  Is this the idiomatic way to 
do it?  I really don't need a bad-assed OO data structure to handle 
this, but I want to write something that isn't write-only ;-)

Thanks in advance for any and all replies.  This is a great, if quiet, list!

-Peter



More information about the Boulder-pm mailing list