WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

[BUG] MVVs are not preserved when used as parameters [5.4.0-prerelease] #9471

@yaisog

Description

@yaisog

Describe the bug

When assigning an MVV with $let and then using that variable as a procedure parameter, its multi-valued nature is not preserved:

\procedure show-items(itemList)
	<h2>itemList</h2>

	<$list filter="[(itemList)]" counter="id" join="<br>" >
		Item number <<id>> is <<currentTiddler>>
	</$list>

	<h2>items</h2>

	<$list filter="[(items)]" counter="id" join="<br>" >
		Item number <<id>> is <<currentTiddler>>
	</$list>
\end

<$let items={{{ [tag[Learning]] }}} >
	<$transclude $variable="show-items" itemList=<<items>> />
</$let>

This should yield two lists with a large number of items each. However, the first list contains only one item.

A closely related problem is the situation when the items list is empty, since the procedure cannot distinguish between an MVV without any elements and an empty variable.
Within the above procedure, [(items)] will then also be empty, but [(itemList)] or [<itemList>] will be an empty string, so the line

<$list filter="[(itemList)]" counter="id" join="<br>" >

would need to be changed to

<$list filter="[(itemList)!is[blank]" counter="id" join="<br>" >

to mostly function the same. However, that will interfere with situations where one of the items can actually be blank (for testing use <$let items={{{ [[]] [tag[Learning]] }}} >).

Expected behavior

MVVs should keep all their properties when used in procedures (and functions).

To Reproduce

Use the above examples on https://tiddlywiki.com/prerelease/

Screenshots

No response

TiddlyWiki Configuration

  • Version 5.4.0-prerelease

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    advancedAdvanced complexity; Backwards compatibility has to be kept in mindnewfeatureNew functionality that does not presently exist

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions