[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread @TiddlyTweeter
I just wanted to add -- as a non-programmer -- that conceptions of TiddlyWiki "programming language" is grasped best by understanding FUNCTIONAL AIMS. In one way you could say its "programming" is a mess. But IS it programming? 1 - Its unusual, in my limited understanding, for being able to

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Monday, March 19, 2018 at 11:36:30 AM UTC+1, Joe Armstrong wrote: > > > The TW equivalent has no variable i but seems to have an implicit variable > It's just a convention, that every widget uses sensible defaults. ... This concept has proven to be sensible for non-programmers. > <> which

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Monday, March 19, 2018 at 11:36:30 AM UTC+1, Joe Armstrong wrote: > > > Now there are 10 quadzilion template languages that can do this. > For example in django I might write > > {% if has_tag("foo") %} >hello I'm a foo >... > {% else %} >hello<>h1> > {% endif %} > This can be

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread Jed Carty
TiddlyWiki isn't supposed to be a programming language. You may be able to extend it so that it can be used as one, but it is a mark-up language that has some advanced templating and macro features. That is very similar to a programming language and I have absolutely on interest in getting into

Re: [tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread Xavier Cazin
Hi Joe, At the surface, the widget-oriented language of TiddlyWiki is just another domain specific language ( https://en.wikipedia.org/wiki/Domain-specific_language) that we have to learn by doing, little by little. SQL or LaTeX are not of the generic kind either, but they are quite adapted to

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread Joe Armstrong
On Monday, 19 March 2018 10:41:20 UTC+1, PMario wrote: > > On Sunday, March 18, 2018 at 11:01:58 PM UTC+1, Joe Armstrong wrote: >> >> >> 4) Execute a loop >> > > In TW everything, that needs looping is done with the <$list widget > . > > It's main purpose is

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread Joe Armstrong
I should explain my question a little more. What I wanted to in pseudo code was something like this: If (this_tiddler_has_tag("foo")) { Hello I'm a foo Click } else { Hello } Now there are 10 quadzilion template languages that can do this. For example in django I might write {% if

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread TonyM
Also If a variable is set to another variable such as <> the value is not frozen as the value at the time you set it, but will return the name of the current tiddler in the context it is used. You can apparently use wikify to freeze the variable. Others can say this better. Tony -- You

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread TonyM
I will add here if the filter read A b b c You would get A b c Or A b c A You would get A b c Because as I conceptualise it the "titles" are deduplicated, because titles are unique. Why because if we had a filter that included taga or tagb We would not want the same tiddler title listed

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Sunday, March 18, 2018 at 11:01:58 PM UTC+1, Joe Armstrong wrote: > > > 5) Define a local (to the tiddler) subroutine and call it > > 6) Define a global subroutine and call it > see: my first post with macros. > It seems to me that a simple table with two columns > showing in the left hand

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Sunday, March 18, 2018 at 11:01:58 PM UTC+1, Joe Armstrong wrote: > > > 4) Execute a loop > In TW everything, that needs looping is done with the <$list widget . It's main purpose is to iterate over a defined set of tiddlers. The set of tiddlers is

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Sunday, March 18, 2018 at 11:01:58 PM UTC+1, Joe Armstrong wrote: > > > 3) Perform an if-then-else or switch operation > In TW if-then most of the time is: "show something" or "hide something" if a special condition is matched. Since the wikitext is automatically refreshed, if the

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-19 Thread PMario
On Sunday, March 18, 2018 at 11:01:58 PM UTC+1, Joe Armstrong wrote: > > So, what is the equivalent tiddler code to perform the following > operations in a conventional programming languages? > > 1) Set a variable to a simple value and use the value > a) In TW "variables" are scoped. b) The

[tw] Re: TW equivalents of some simple expressions in common programming langauges

2018-03-18 Thread Jed Carty
Wikitext isn't a Turing completely language, there aren't necessarily equivalents to what you are talking about. TiddlyWiki has very few attributes of a normal programming language, I don't think that tiddlywiki has the equivalent of a procedure from an imperative programming language. You can