What does alias do?

xtreak via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Sat Apr 23 12:52:15 PDT 2016


On Saturday, 23 April 2016 at 19:49:46 UTC, xtreak wrote:
> I am a D newbie from Python and I am trying to grok alias. Is 
> alias like Python does as below
>
> L = []
> myextend = L.extend
> L.myextend
>
> Renaming imported function
>
> from itertools import permutations as p
> p([1, 2], 2)
>
> Is D aliasing the same as above? How does aliasing types help 
> like below
>
> alias intList = LinkedList!int
>
> Is the above like a partially applied template as in 
> LinkedList!int([1, 2, 3]) and hence can I use it like 
> intList([1, 2, 3])?

Adam D Ruppe was helping me on #d . I just thought posting to 
forum will have more people to discuss on this. Sorry for the 
double post.




More information about the Digitalmars-d-learn mailing list