Why macros/procedures at all, if there are parametrized transclusions?

What am I missing:

As we know, version 5.3.0 will introduce procedures as a superior alternative to macros. There is also the introduction of parametrized transclusions.

But why will macros or procedures at all be needed if we have paramertrized transclusions? I.e why would I call <<myprocedure foo>> when I can transclude {{mytiddler|foo}} that has the same “content”?

What is possible with a procedure that is not possible with a parametrized transclusion?

As we know, macros/procedures require special tags and they refresh the page when updated and you can’t quite “live update” them because of this. This is not the case with transclusions (…or maybe it is for paramatrized such?)

Given the amount of work, and the excitement, that have gone into enabling procedures I’m obviously missing something, but what?

Well worth asking this question.

One small reason is if you name a procedure it is only visible when called, where as a transcluded tiddler will appear in standard searches unless you make it a system tiddler {{$:/mytiddler|foo}} and then you would more likely extend even that {{$:/mytransclusions/mytiddler|foo}}

1 Like

Not an answer to your question, but ten procedures can be stored in one tiddler, while each tiddler for transclusion needs its own tiddler.

1 Like

We need procedures because we are not allowed to break macros. In a world, where backwards compatibility does not matter we could replace the behaviour of macros with the behaviour of procedures and call it macros.

But you are right activating macros and procedures with <<name>> are shortcut functions for the macrocall-widget and the transclude-widget. … So they are convenience functions.

Technically we could remove them without loosing functionality. … just convenience.

@pmario - as far as I can tell, you’ve misread my question. I’m asking why only “parametrized tansclusions” is not sufficient instead of both macros/procedures. And regardless if “shortcut syntax” or full invocation.

In 5.3.0, what can be achieved with procedures that cannot be achieved with transclusions?

Thanks.

You can use parametrised transclusions only if you want. The other stuff is only there for backwards compatibility and convenience.

I think there is a strong argument for completeness if nothing else, but I think a key motivation was to “fix” issues in substitutions in /define[d] macros which demanded a replacement.

OH!!! I’m genuinely surprised. This puts the new features in a new light for me. Maybe it is all the talk about procedures that have given me the impression that that was the bigger deal. But it is not mentioned in the docs that transclusions really, or at least almost, make proc/macros redundant. I think this is a pretty big deal.

I say “almost redundant” because there are still the differences that @TW_Tones and @TW_Tones point out, right? Ironically though, placing multiple procedures into a single tiddler is against Tiddler Philosophy! So I guess that further speaks for using translcusions instead of procedures.

One could, evidently, argue that “parametrized transclusions” is the replacement though. It wouldn’t fix what was broken, it would put what was broken aside and bring in the new golden calf to worship.

1 Like

I am not sure I read it the same way, many of the core macros are defined in the same tiddlers as others. What ever was the practice with macros stand with procedures. For example many plugins bundle there supporting macros in one tiddler.

Exactly! - If the macros can be used independently of one another - or at least if they are used independently of one another - then that is NOT aligned with tid.philosophy.

The reason we “get away” with it is because macros are individually addressable. But if that is OK, then why shouldn’t textual segments be addressable (i.e TW2 slices)?

I’m not being dogmatic about tiddler philosophy; I actually do wish we would have “slices” and I really would want to redefine what a tiddler is to, instead of “smallest semantically meaningful unit”, define it as “smallest contextually meaningful unit”. IMO the latter is much more real world.

But I’m digressing from the OP :slight_smile:

I look it as the tiddler title is the key to unique info and unlike other databases the key is “at eye level” but this can also mean a data tiddler is still not breaking this rule as long as they contents relate to the key/title, the whole key and nothing but the key.

There are indeed similarities between parameterised transclusion of a tiddler and parameterised transclusion of a procedure. The difference between them is how the text that is to be transcluded is defined: either a tiddler, or a variable.

So, @twMat’s question is actually equivalent to asking why we have variables and not just tiddlers.

The fundamental answer is that variables have the ability to be redefined to have different values across the widget tree, while tiddlers always have the same value everywhere.

That means that it is possible to write wikitext that includes a procedure call like <<myref "Something">> and then define the operation of myref differently in different contexts.

So, the thing that can be achieved with procedures (ie transclusion of variables) that cannot be achieved with transclusion of tiddlers is that the text of the procedure can be context-dependent.

There are some answers in this thread that I think are misleading:

It is not true that macros/procedures/functions/widgets are no longer required now that we have parameterised transclusion, and are only there for backwards compatibility.

4 Likes

OK, that makes sense. Thanks.

I’m confused about the initial sentence though. Should it perhaps read “…and invocation of a procedure.” ? (I’m not picking words, I want to ensure I really understand.)

1 Like

Yes. We have used different words in the past and may introduce a little confusion even if its is technically perhaps correct.

I don’t think the word “invocation” is needed here because I wouldn’t think of the similarities as being restricted to the way that these variants are invoked.

1 Like

AHA! Procedures are indeed transclude: There is no “ProcedureCallWidget” and MacroCallWidget is deprecated - now only TranscludeWidget:

image

Thanks.

I kinda wish there was :nerd_face:

will achieve that I slump my shoulders and become depressed because TW talk will become even more indecipherable to me and to other non-techies and newbies. Grok and Charlie better up their games to create instructions and tutorials and videos FAST.