Module talk:Rail: Difference between revisions

Content deleted Content added
Module redirect: not different
Line 11:
: {{ping|Paine Ellsworth}} It's a hard redirect in that {{mlx|Rail|...}} is equivalent to {{mlx|Adjacent stations|...}}. The only way in which it is not a redirect is that actually viewing [[Module:Rail]] doesn't get redirected, making this work in much the same way as a template redirect that is nominated at RfD. [[User:Pppery|{{3x|p}}ery]] ([[User talk:Pppery|talk]]) 17:27, 24 March 2019 (UTC)
::We have two views: [[User:Pppery|yours]] is that [[:Module:Rail]] behaves as a hard redirect when invoked, and [[User:Johnuniq|Johnuniq]]'s is that it's technically not possible to redirect to a module, and rightly means that to "put some very small code at the 'redirect' page which executes the target module and returns its table" is different by definition from #[[WP:REDIRECT|REDIRECT]]. This all seems to me to mean that while this module is not by definition a redirect, it does behave as one by "calling" [[:Module:Adjacent stations]] when it's invoked. Has this been tested? Maybe if we ask [[User:Ythlev|Ythlev]], who set out to improve ''Module:Adjacent stations'' by creating this module? And if testing has shown or will show that this is or is not an "effective" and useful "redirect", what then? Where do we go from there? '''''[[User:Paine Ellsworth|<span style="font-size:95%;color:darkblue;font-family:Segoe Script">Paine&nbsp;Ellsworth</span>]]'''''<small>,&nbsp;ed.&nbsp;&nbsp;[[User talk:Paine Ellsworth|<sup>put'r&nbsp;there</sup>]]&nbsp;</small>&nbsp;<small>16:34, 26 March 2019 (UTC)</small>
:::I do not think that Pppery and I are saying different things. Using #REDIRECT in a module will result in a broken module (because it is not valid Lua) and will not act as a redirect. However, putting a small amount of code in a module will make it behave exactly like a redirect as far as #invoke is concerned. For an editor viewing the page, it will look somewhat like a soft redirect because it will not redirect them. An example is [[Module:Location map/data/New York]] which contains:
:::<code>return require('Module:Location map/data/USA New York')</code>
:::which acts like a redirect to [[Module:Location map/data/USA New York]]. [[User:Johnuniq|Johnuniq]] ([[User talk:Johnuniq|talk]]) 20:18, 26 March 2019 (UTC)