Hi Tony

> I am concerned about new users who want to implement maths but have not yet 
> fully grasped filter concepts, this includes variables, transclusions and 
> references in maths filters.

Conversely, if we'd introduced another new mechanism then there would be even 
more to learn. TiddlyWiki's primitives might be hard to learn, but they are 
endlessly reused, and so the bit and pieces that one has to learn applies over 
and over.

> Could we try and make the documentation spell out how to achieve common uses? 
> I would be happy to contribute here of course.

Yes, the documentation is a work in progress and contributions are very welcome.

> I am keen to ensure we document how to use maths in the following high level 
> cases with variables, transclusions and references
> Within wikiText
> Within Filters (in this case interacting with title lists)
> Within Widgets and HTML - Parameters and Attributes
> Within macro definitions / macro body
> Within a Macro call or for a "macro parameter"
> and Concatenating values for use in maths formulae
Note that there's nothing specific about the maths operators; they are used 
just the same as the other filter operators.  If you know how to use filter 
operators then you know how to use the new maths operators.

> Since this is new I am not yet in a position to test it, but will we be able 
> to retrieve the maths results an use them in the above as easily as we can 
> with Evans (= mushroom brackets =) ? Perhaps we can provide an easy method to 
> allow "substitution" of a maths result such as $(mathresult)$ may imply.

The implications of my earlier explanation might not be clear. We're reusing 
the filtering mechanism. There is no new syntax like the mushroom brackets 
because we're reusing the filtering mechanism. We don't need any new method of 
substitution because we're reusing the filtering mechanism.

Best wishes

Jeremy

> 
> 
> Regards
> Tony
> 
> 
>> On Friday, February 8, 2019 at 8:42:06 AM UTC+11, Jeremy Ruston wrote:
>> Hi Mat
>> 
>> Great, glad you like it! This is a new implementation that emerged from 
>> discussions about a different issue on GitHub (see 
>> https://github.com/Jermolene/TiddlyWiki5/pull/3572#issuecomment-460958193).
>> 
>> It is a bit different than Matt’s Calc plugin 
>> <https://github.com/mklauber/tiddly-calc> and Evan’s Formula plugin 
>> <https://github.com/EvanBalster/TiddlyWikiFormula>. It doesn’t use 
>> conventional “postfix” maths notation (ie, the familiar stuff like (2+2)/3 
>> etc.). Instead, it implements maths operations as filter operators that work 
>> the same way as others except that they interpret their arguments as numbers 
>> and numeric results are converted to strings.
>> 
>> I went for this approach because it makes things really, really small and 
>> simple: by re-using all the existing filter operator infrastructure we avoid 
>> having to add or implement a new expression parser. On the other hand, it 
>> means that it isn’t much use for formulae that have been entered by users 
>> not familiar with TiddlyWiki’s filter syntax. We’ll still need plugins like 
>> those above for those applications.
>> 
>> I haven’t quite finished the documentation, but the list of new operators is 
>> as follows - there are new string operators like split and join as well as 
>> the maths operators:
>> 
>> negate - negation
>> abs - absolute value
>> ceil - smallest integer greater than or equal to a given number
>> floor - the largest integer less than or equal to a given number
>> round - the value of a number rounded to the nearest integer
>> trunc - the integer part of a number by removing any fractional digits
>> sign - the sign of a number, indicating whether the number is positive, 
>> negative or zero
>> add - add an operand to every number in the input list
>> subtract - subtract an operand from every number in the input list
>> multiply - multiply every number in the input list by an operand
>> divide - divide every number in the input list by an operand
>> remainder - replace each item in the input list with the remainder when 
>> dividing that number by an operand
>> max - replace any number in the input list larger than the operand with the 
>> operand
>> min - replace any number in the input list smaller than the operand with the 
>> operand
>> fixed - formats a number using fixed-point notation with the number of 
>> fractional digits after the decimal point given by the operand
>> precision - returns a string representing the number to the precision 
>> specified in the operand
>> exponential - returns a string representing the Number object in exponential 
>> notation with the number of digits after the decimal point specified in the 
>> operand
>> sum - replaces the input list with the sum of all the entries
>> product - replaces the input list with the product of all the entries
>> maxall - replaces the input list with the maximum value of all the entries
>> minall - replaces the input list with the minimum value of all the entries
>> length - replaces each item in the input list with its string length in 
>> characters
>> uppercase - replaces each item in the input with its uppercase equivalent
>> lowercase - replaces each item in the input with its lowercase equivalent
>> trim - trims each item in the input list
>> concat - concatenates all of the items in the input list into a single string
>> split - splits each of the items in the input list by a given separator
>> join - joins all of the items in the input list with a given separator
>> 
>> As usual, any comments and thoughts welcome,
>> 
>> Best wishes
>> 
>> Jeremy
>> 
>> 
>> 
>>> On 7 Feb 2019, at 20:42, Mat <[email protected]> wrote:
>>> 
>>> Hi guys! ...in spite of my absence I do 'peek by' occasionally and I just 
>>> noted that math operators are added to the prerelease!
>>> 
>>> I just want to thank whoever is behind this (Evan?), plus Jeremy for 
>>> including it in core! Basic math ops is one of those things that anyone 
>>> needs either sooner or later in a utility tool like TW, so: THANK YOU!
>>> 
>>> Also, anyone curious about TW should hear about this right away so it 
>>> deserves a mention in HelloThere.
>>> 
>>> IMO, "basic math" was the missing piece to fulfill the "minimum of a fully 
>>> general note-taking tool" - i.e: produce text, produce images, do 
>>> calculations.
>>> 
>>> Wonderful!
>>> 
>>> <:-)
>>> 
>>> P.S sorry for my absence but it will continue for a while.
>>> 
>>> -- 
>>> You received this message because you are subscribed to the Google Groups 
>>> "TiddlyWiki" group.
>>> To unsubscribe from this group and stop receiving emails from it, send an 
>>> email to [email protected].
>>> To post to this group, send email to [email protected].
>>> Visit this group at https://groups.google.com/group/tiddlywiki.
>>> To view this discussion on the web visit 
>>> https://groups.google.com/d/msgid/tiddlywiki/1eaad72c-4e80-4999-926c-13cf7ea16ba8%40googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "TiddlyWiki" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/tiddlywiki.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/tiddlywiki/1cefed6d-d923-48dd-8f15-c83c55565cc1%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/38BDFE36-ADD0-47E1-9842-68F49EA7A500%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to