ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* Why are pretty printer names uppercased?
@ 2009-08-26  8:52 Matthijs Kooijman
  2009-08-26  9:11 ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Matthijs Kooijman @ 2009-08-26  8:52 UTC (permalink / raw)
  To: ntg-context


[-- Attachment #1.1: Type: text/plain, Size: 1253 bytes --]

Hi all,

according to the wiki, and the current code, the arguments to
\installprettytype should be uppercased. E.g.:

  \installprettytype [PHP]        [PHP]

Referring to them should be uppercased as well:
  \definetyping[PHP]   [option=PHP]
  \setuptyping[option=PHP]

However, the filename should be lowercase, e.g. pret-php.lua and the pretty
printer should register itself in lowercase as well:
buffers.newvisualizer("lua"). The first thing that happens to the arguments of
installprettytype is to lowercase them, and every option= argument that points
to a pretty printer is lowercased by setvisualizer in lua before being used.

If everything is lowercased, why do we still recommend the arguments to
\installprettytype and option= to be uppercase? IMHO this makes things
confusing when trying to understand which PHP refers to which php or PHP in
the greater picture of things. 

Why not recommend people to use lowercase identifiers instead, since we're
changing everything into lowercase anyway? Or perhaps go a bit further and
remove the lowercasing code alltogether, since I don't see any real gain. If
the strings / filenames should just match exactly, things will get a lot more
predictable?

Gr.

Matthijs

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are pretty printer names uppercased?
  2009-08-26  8:52 Why are pretty printer names uppercased? Matthijs Kooijman
@ 2009-08-26  9:11 ` Hans Hagen
  2009-08-26  9:37   ` Matthijs Kooijman
  0 siblings, 1 reply; 4+ messages in thread
From: Hans Hagen @ 2009-08-26  9:11 UTC (permalink / raw)
  To: ntg-context

Matthijs Kooijman wrote:
> Hi all,
> 
> according to the wiki, and the current code, the arguments to
> \installprettytype should be uppercased. E.g.:

because want uppercase

\startTEX
\stopTEX

\startMP
\stopMP

\startLUA
\stopLUA

>   \installprettytype [PHP]        [PHP]
> 
> Referring to them should be uppercased as well:
>   \definetyping[PHP]   [option=PHP]

defining indeed, as it is an instance, but option also accepts lowercase

> However, the filename should be lowercase, e.g. pret-php.lua and the pretty
> printer should register itself in lowercase as well:
> buffers.newvisualizer("lua"). The first thing that happens to the arguments of
> installprettytype is to lowercase them, and every option= argument that points
> to a pretty printer is lowercased by setvisualizer in lua before being used.

indeed. as i don't like casing in filenames, and function names

> If everything is lowercased, why do we still recommend the arguments to
> \installprettytype and option= to be uppercase? IMHO this makes things
> confusing when trying to understand which PHP refers to which php or PHP in
> the greater picture of things. 

because they generate commands and it's quite valid to say

\definetyping[myphp]

etc

> Why not recommend people to use lowercase identifiers instead, since we're
> changing everything into lowercase anyway? Or perhaps go a bit further and
> remove the lowercasing code alltogether, since I don't see any real gain. If
> the strings / filenames should just match exactly, things will get a lot more
> predictable?

actually, the advice is that user definitions use uppercase

\definehead[MySection][section]

etc, just to avoid clashes with built in commands

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are pretty printer names uppercased?
  2009-08-26  9:11 ` Hans Hagen
@ 2009-08-26  9:37   ` Matthijs Kooijman
  2009-08-26  9:47     ` Hans Hagen
  0 siblings, 1 reply; 4+ messages in thread
From: Matthijs Kooijman @ 2009-08-26  9:37 UTC (permalink / raw)
  To: mailing list for ConTeXt users


[-- Attachment #1.1: Type: text/plain, Size: 1178 bytes --]

Hi Hans,


>> according to the wiki, and the current code, the arguments to
>> \installprettytype should be uppercased. E.g.:
>>
>>   \installprettytype [PHP]        [PHP]
> because want uppercase
>
> \startTEX
> \stopTEX

Well, those would be coming from the first argument of definetyping. AFAIU,
neither argument to installprettytype is related to these commands.

>>   \definetyping[PHP]   [option=PHP]

> indeed. as i don't like casing in filenames, and function names
Agreed, me neither.

> actually, the advice is that user definitions use uppercase
>
> \definehead[MySection][section]
>
> etc, just to avoid clashes with built in commands
That makes sense for commands, which is not what I'm proposing to change. I
would propose making it look like the following:

\installprettytype [php]        [php]
\definetyping      [PHP]        [option=php]

Here, the second "php" refers to "pret-php.lua", the first and last "php"
refer to each other and to the "php" in newvisualizer("php").

The command defined is still \startPHP, but now the values that refer to other
lowercase things (filename, pretty printer name) are lowercase consistently.

How's this?

Gr.

Matthijs

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

[-- Attachment #2: Type: text/plain, Size: 487 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Why are pretty printer names uppercased?
  2009-08-26  9:37   ` Matthijs Kooijman
@ 2009-08-26  9:47     ` Hans Hagen
  0 siblings, 0 replies; 4+ messages in thread
From: Hans Hagen @ 2009-08-26  9:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Matthijs Kooijman wrote:
> Hi Hans,
> 
> 
>>> according to the wiki, and the current code, the arguments to
>>> \installprettytype should be uppercased. E.g.:
>>>
>>>   \installprettytype [PHP]        [PHP]
>> because want uppercase
>>
>> \startTEX
>> \stopTEX
> 
> Well, those would be coming from the first argument of definetyping. AFAIU,
> neither argument to installprettytype is related to these commands.


sure but they are somewhat related (also with the color palets then)

>>>   \definetyping[PHP]   [option=PHP]
> 
>> indeed. as i don't like casing in filenames, and function names
> Agreed, me neither.
> 
>> actually, the advice is that user definitions use uppercase
>>
>> \definehead[MySection][section]
>>
>> etc, just to avoid clashes with built in commands
> That makes sense for commands, which is not what I'm proposing to change. I
> would propose making it look like the following:
> 
> \installprettytype [php]        [php]
> \definetyping      [PHP]        [option=php]
> 
> Here, the second "php" refers to "pret-php.lua", the first and last "php"
> refer to each other and to the "php" in newvisualizer("php").
> 
> The command defined is still \startPHP, but now the values that refer to other
> lowercase things (filename, pretty printer name) are lowercase consistently.
> 
> How's this?

in order to get that working and remain compatible, we'd also need to 
redefine

\definepalet [TEXcolorpretty] [colorpretty]
\definepalet [TEXgraypretty]  [graypretty]

(ans use some nasty trickery to let texcolorpretty and TEXcolorpretty 
both be valid)

etc and as users themselves seldom see the low level definitions it's 
not worth the trouble

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
      tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2009-08-26  9:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-26  8:52 Why are pretty printer names uppercased? Matthijs Kooijman
2009-08-26  9:11 ` Hans Hagen
2009-08-26  9:37   ` Matthijs Kooijman
2009-08-26  9:47     ` Hans Hagen

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).