ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Mojca Miklavec" <mojca.miklavec.lists@gmail.com>
To: "mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: database
Date: Wed, 24 Jan 2007 03:44:40 +0100	[thread overview]
Message-ID: <6faad9f00701231844h683f6478xcf52b62ecff98ada@mail.gmail.com> (raw)
In-Reply-To: <45B5D928.817.54AB83@wwl.musensturm.de>

On 1/23/07, Wolfgang Werners-Lucchini wrote:
> Hallo!
>
> I tried some examples with m-database and Mojca's 'My Way' and had
> some problems
>
> ==========Example-1===============================================
> \defineseparatedlist[NaturalTable][separator=comma,%quotechar={"},
>                                                   before=\bTABLE,
>                                                   after=\eTABLE,
>                                                   first=\bTR,
>                                                   last=\eTR,
>                                                   left=\bTD,
>                                                   right=\eTD]
>
> \startseparatedlist[NaturalTable]
> Of,course
>     ,it is!
> \stopseparatedlist
> ==================================================================
> This example does only work as expected if one explicitly gives
> quotechar. So what is the default quotechar? Can anybody explain the
> above behaviour?

If you activate "quotechar", you're using completely other macros to
process the data (CSV-like), \TeX-commands won't work.

I first wanted to write that the example above without quotechar is a
documented bug. But then I remembered that it was already fixed. I
looked at the csv.tex again and tried to process it when I figured out
that it doesn't even compile any more.

Hmmm ... I don't have time to play until friday. It might be that I
have some weird local version of m-database which is causing me
problems or vice versa. I'll take a look at the end of the week (but I
don't know how to fix serious bugs, so it will still be Hans's turn to
fix what I find).

With quotechar it probably works because Taco's code (with quotechar)
was less buggy than Hans's ;)

A bit of history: when I asked for that "module", I got two responses
- one from Hans and one from Taco. Each one of them has "invented" his
own way of dealing with such input, but Taco's way works like
\type{\TeX will be ignored}, while Hans's way obeys \TeX commands, so
you can use \bf and such ...
Since they were both useful, Taco has merged the two. But the
difference is probably not documented well enough.

==========Example-2===============================================
> \def\Whatever#1#2#3{[#1][#2][#3]\endgraf}
>
> \defineseparatedlist[CSVX][command=\Whatever,
>    separator={,},
> %   quotechar={"},
>    first=\bTR,last=\eTR,
>    left=\bTD,right=\eTD,
>    before=\bTABLE,after=\eTABLE]
>
> \startCSVX
> eins,"und, zwei",drei
> one,two,three
> \stopCSVX
> ==================================================================
> If I give an command (\Whatever) then the options 'first', 'last',
> 'left', 'right', 'before' and 'after' are ignored. That's ok, I
> think!

I guess that I asked Hans for that behaviour, although it could be
either way. I don't know if that's sensible or not, but you can place
"first" and "last" inside the definition of \Whatever; "left" and
"right" might need slightly more typing (if you decide that you need
to do something repetitive on all the nine cells, so perhaps that's
not so useless), but when I think a bit more about it ... "before" and
"after" don't have their counterpart.

It's a bad practice to define both command and left/right/first/last
anyway ... so perhaps at least before and after (maybe left/right)
should be enabled again?

(I always have problems because I never know which one does what - I
always mix up left/before/first ...)

> But if I uncomment the quotechar option, then the options 'left' and
> 'right' are no longer ignored. Commenting them out or settings like
> 'left=' etc. are not working. What I am doing wrong here?

Taco's mode works differently. It's probably because I never tested
that and/or reported problems. Thing should better be unified in this
respect. (I have to test a bit - end of week.)

==========Example-3===============================================
> \processquotedlist(){,}{"}\command(a=>b=>c=>d)
> ==================================================================
> Does not work for me. Can anybody give an example?

The thing right to \command is purely symbolic I guess (but don't aks
me how "Taco's ugliest macro" works ;).

But: it's low-level command I guess. It's not "documented" in MyWay either.

> '\processseplist' does not work too. There has to be an '%' in front
> of 'raw'!

You're probably right about that '%'.
But \processseplist should be an internal command unless I'm missing something.

(LaTeX uses lots of '@' for internals and has so unreadable code ...
ConTeXt has better readability, but I sometimes feel that some
commands should be better hidden from the outside world - most
low-level commands are "visible" to the user, which shouldn't be the
case).

Mojca

  reply	other threads:[~2007-01-24  2:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-23  8:45 database Wolfgang Werners-Lucchini
2007-01-24  2:44 ` Mojca Miklavec [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-07-07 10:13 Database Willi Egger
2003-04-23 18:55 database LEGUEDOIS, Frederic
2003-04-25 10:23 ` database Taco Hoekwater
2003-04-25 11:21   ` database Hans Hagen

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=6faad9f00701231844h683f6478xcf52b62ecff98ada@mail.gmail.com \
    --to=mojca.miklavec.lists@gmail.com \
    --cc=ntg-context@ntg.nl \
    /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).