[seqfan] Re: submitting a program, while preserving preformatted text

Richard Mathar mathar at strw.leidenuniv.nl
Sun Sep 5 12:49:34 CEST 2010


Back to http://list.seqfan.eu/pipermail/seqfan/2010-September/005944.html

There is the formatting standard to replace spaces or tabs by dots
to preserve the Python (which of course includes SAGE) indentation.
See the "Python examples, sequences related to" in http://oeis.org/classic/Sindx_Ps.html.
I would strongly suggest to follow a discipline of naming the functions
according the A-numbers they compute so (i) we can build a library of OEIS
functions in Maple, Mma, Python, Java, C/C++, perl, Pari/gp in the future,
and (ii) a search for the Axxxx returns the piece of code wherever it is
used.
So Axxxxx(n) returns the value at index n, isAxxxxx(n) tests the value against
being in the sequence, Axxxxx_list(n) returns the first n values, Axxxx_row(n)
returns the n-th row in an array or triangle, Axxxx(n,k) returns the value
in row n, column k.
(I am aware of the fact that recommendations of that kind have been made in
the past, and I am only one out of two contributors who have adopted such a
strategy in submissions of Maple, pari and python.):
http://www.strw.leidenuniv.nl/~mathar/progs/pdocs/oeis_core.html

I am using tabs for indentation (for all the standard reasons), then piping the
source code through a bash script (here the same as the corresponding
ksh or csh or tcsh) before pasting it into the OEIS submission form :

#!/bin/bash

# usage:
#  py2oeis < file.in

sed 's/\t/.../g' | awk '{ printf "%s\\Q\n",$0}'





More information about the SeqFan mailing list