texmacs-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Texmacs-dev] Patch 1168


From: Nix N. Nix
Subject: Re: [Texmacs-dev] Patch 1168
Date: 03 Mar 2003 08:03:14 -0700

On Mon, 2003-03-03 at 04:12, address@hidden wrote:

[...]

> > Unfortunately, I don't know how to execute these test suites.  I have
> > tried adding either of the followings to my my-init-texmacs.scm file,
> > but I got an "unbound variable" error in both cases:
> > 
> > (regtest-tmtex-table)
> > 
> > (regtest-tmtex)
> 
> The test suite are not loaded at initialization (because the casual user 
> never need them).
> 
> So you need to load them first, with something like:
> 
>   (exec-file "$TEXMACS_PATH/progs/convert/tmtex/tmtex-test.scm")

OK. Will do.

> 
> 
> > Consequently, I was unable to verify the test suites, even the small
> > change I made in tmtex-test.scm . I was also unable to add new tests to
> > the tmtex test suite, although I did test my code by converting this
> > file (attached["*.tm"]) to LaTeX to correctly obtain all table borders
> > (attached["*.pdf"]).  I have also converted the same file to html, and
> > it seems OK, although I don't know what the capabilities of the html
> > converter are.
> 
> For tables, the same as the old tmtex converter.

[...]

> If you you think you are getting in the spirit of it, you can try
> improving the tmtable code.

OK - maybe trying to factor out some of the common code in all those
accessors. Maybe ...

> 
> BTW: a few notes about style.
> 
>   -- all code must be line wrapped at the 79th column.

Check.

> 
>   -- really try hard to make your code as readable as possible (your
>      tmtex patch is not yet quite okay in that respect).

Well, I usually do something like this, before trying to make my code
look more like TeXmacs code:

(define (function arg)
    (let*
    (
    (name (binding1))
    (name (binding2))
    )
    (cond
        ((cond1)
            (append
                (list (arg1) (arg2))
                (list (arg3) (arg4))
            )
        (else '())
        )
    )
    )
)

... and then I condense it.  As you can see, I tend to use a lot of
lines for making the code especially readable for myself.  I guess I
must be more wary of the way I condense thereafter.

> 
>      That involves not trying to pack as much stuff as possible in a
>      line, instead a line should be a unit of significance. But also
>      you should try to keep the code compact.

One small thing I noticed along these lines: wouldn't

(let* (
  (name0 (binding1))
  (name1 (binding0))
  ...)
  ...

be better than

(let* ((name0 (binding1))
  (name1 (binding0))
  ...)
  ...

?  I know, it's less compact, but this way, all bindings are indented
likewise. The first binding is no more special than any of the others,
right ?

> 
>      Any good hacker will tell you: good code lends itself well to a
>      pretty presentation. You can often tell good code from bad code
>      simply by the shape of the text blocks on the screen.
> 
>   -- try to mimic the whitespace conventions you see in the rest of
>      the code.

Check.

> 
> I appreciate very much your code contributions. Keep going.

No problem.  As I convince more and more people to use TeXmacs, I get to
find out what they expect of it.  I want them to have what they expect
before they need it.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]