Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Parameterised Transclsuon: Function Invoking in Filter Returns Different Results #7407

Closed
kookma opened this issue Apr 20, 2023 · 4 comments

Comments

@kookma
Copy link
Contributor

kookma commented Apr 20, 2023

Describe the bug

Function question

Aren't these the same, why they return different results?

\function f(date) [tag[Learning]]:filter[get[created]split[]first[4]join[]compare:number:gt<date>]

<$list filter="[function[f],[2018]]" >
<$link/> - <$text text={{{ [{!!created}split[]first[4]join[]] }}}/><br>
</$list>

<$list filter="[<f 2018>]" >
<$link/> - <$text text={{{ [{!!created}split[]first[4]join[]] }}}/><br>
</$list>

The last example only returns the first output!
@btheado: Can we conclude the second example is similar to what you said for <<myfun param>>? So even calling a function inside a filter expression using <> it returns the first output!

TiddlyWiki Configuration

https://tiddlywiki.com/prerelease/parameterised-transclusions/

Additional context

See also

@saqimtiaz
Copy link
Member

Can we conclude the second example is similar to what you said for <<myfun param>>? So even calling a function inside a filter expression using <> it returns the first output!

Yes, your second example uses the function as a variable so both scenarios are the same.

@kookma
Copy link
Contributor Author

kookma commented Apr 20, 2023

Thank you Saq! This is a little confusing and I would recommend clarifying this in the official docs.
I assume the PR for docs should target parameterised-transclusions branch. I will prepare some explanation on this.

@kookma kookma closed this as completed Apr 20, 2023
@saqimtiaz
Copy link
Member

@kookma docs updates for parametrised transclusions should target the master branch, since the PR has been merged.

@kookma
Copy link
Contributor Author

kookma commented Apr 20, 2023

Thank you @saqimtiaz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants