create new tag
, view all tags
Might what we call variables (and started out as variables, e.g. WIKIWEBMASTER) be more properly called directives because they cause a computation to be done rather than just doing a lookup? Or am I being finicky?

-- MartinCleaver - 22 Jun 2001

Good question. This depends how you look at it.

  1. Directive: As you pointed out.
  2. Variables: From a OS or platform point of view. TWiki is considered a platform; a TWiki variable is like the system variables in Windows.
  3. Macro: From a compiler/interpreter point of view. TWiki is considered an interpreter that does some preprocessing (e.g. macro substitution) before compilation/interpretation (e.g. rendering)

So, lets stick with the "variable" wording because there is no clear line.

-- PeterThoeny - 23 Jun 2001

The syntax reminds me of [X|HT]ML tags - perhaps these are all kinds of TWiki tags?

-- SteveRoe - 28 Jun 2001

I think there is a clear line between variable and directive. System variables don't change their parameters depending on an argument.

To support Directive, this is a term used by software like Apache.

I agree that the distinction between macro and directive is less clear-cut.

-- MartinCleaver - 17 Nov 2001

Sticking to a word that's misleading seems a bit silly. Variables do not take arguments, either from a programming or mathematical point of view. I have no idea what, if anything, non-technical people (by technical people I also mean scientists, engineers, doctors, or many others who have more than a passing knowledge of math or programming.)

-- MeredithLesly - 22 Jun 2006

The vast majority of TWiki "variables" are macros in the sense of "a function that takes zero or more parameters, gets evaluated and returns some text which is substituted in place of the call". The "predefined variables" with no parameters aren't variables because they are read-only, and even "preference variables" are only single-assignment. Very few could be called "directives", i.e. declarations or commands, (STARTSECTION is an example).

There is of course a long history in computing of oxymoronic "read-only variables".

This may all seem academic but I think it suggests some potential simplifications and improvements:

  • Make everything redefinable, possibly multiple times within one topic (security permitting).
  • Allow user-defined macros with parameters (the fact that someone called these ParameterizedVariables shows the confusion that has arisen).

-- DenisHowe - 27 Jul 2006

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r9 - 2008-08-17 - RafaelAlvarez
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.