What does _. mean in patterns?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
3
down vote

favorite
1












Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.



What does _. mean? As in _,_. as opposed to _,_ or _,_,_. as opposed to _,_,_?



Thanks!










share|improve this question





















  • I may have found it - it might represent Default, but I have to do some more reading.
    – Jmeeks29ig
    2 hours ago










  • That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
    – Jmeeks29ig
    2 hours ago










  • @Szabolcs You forgot a /. coef_. a :> coef :)
    – xzczd
    2 hours ago






  • 1




    @xzczd You are right. I deleted my comment (it was incorrect).
    – Szabolcs
    2 hours ago






  • 2




    "I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
    – xzczd
    2 hours ago














up vote
3
down vote

favorite
1












Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.



What does _. mean? As in _,_. as opposed to _,_ or _,_,_. as opposed to _,_,_?



Thanks!










share|improve this question





















  • I may have found it - it might represent Default, but I have to do some more reading.
    – Jmeeks29ig
    2 hours ago










  • That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
    – Jmeeks29ig
    2 hours ago










  • @Szabolcs You forgot a /. coef_. a :> coef :)
    – xzczd
    2 hours ago






  • 1




    @xzczd You are right. I deleted my comment (it was incorrect).
    – Szabolcs
    2 hours ago






  • 2




    "I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
    – xzczd
    2 hours ago












up vote
3
down vote

favorite
1









up vote
3
down vote

favorite
1






1





Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.



What does _. mean? As in _,_. as opposed to _,_ or _,_,_. as opposed to _,_,_?



Thanks!










share|improve this question













Here is a quick one, hopefully. I searched through different tutorials and documentation articles but haven't been able to find anything yet.



What does _. mean? As in _,_. as opposed to _,_ or _,_,_. as opposed to _,_,_?



Thanks!







pattern-matching argument-patterns






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked 2 hours ago









Jmeeks29ig

3066




3066











  • I may have found it - it might represent Default, but I have to do some more reading.
    – Jmeeks29ig
    2 hours ago










  • That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
    – Jmeeks29ig
    2 hours ago










  • @Szabolcs You forgot a /. coef_. a :> coef :)
    – xzczd
    2 hours ago






  • 1




    @xzczd You are right. I deleted my comment (it was incorrect).
    – Szabolcs
    2 hours ago






  • 2




    "I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
    – xzczd
    2 hours ago
















  • I may have found it - it might represent Default, but I have to do some more reading.
    – Jmeeks29ig
    2 hours ago










  • That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
    – Jmeeks29ig
    2 hours ago










  • @Szabolcs You forgot a /. coef_. a :> coef :)
    – xzczd
    2 hours ago






  • 1




    @xzczd You are right. I deleted my comment (it was incorrect).
    – Szabolcs
    2 hours ago






  • 2




    "I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
    – xzczd
    2 hours ago















I may have found it - it might represent Default, but I have to do some more reading.
– Jmeeks29ig
2 hours ago




I may have found it - it might represent Default, but I have to do some more reading.
– Jmeeks29ig
2 hours ago












That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
– Jmeeks29ig
2 hours ago




That seems to make sense. I am trying to use it in context of pattern matching, using SyntaxInformation, to get the required arguments of some random function, and then insert values into the function in the proper order
– Jmeeks29ig
2 hours ago












@Szabolcs You forgot a /. coef_. a :> coef :)
– xzczd
2 hours ago




@Szabolcs You forgot a /. coef_. a :> coef :)
– xzczd
2 hours ago




1




1




@xzczd You are right. I deleted my comment (it was incorrect).
– Szabolcs
2 hours ago




@xzczd You are right. I deleted my comment (it was incorrect).
– Szabolcs
2 hours ago




2




2




"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
– xzczd
2 hours ago




"I searched through different tutorials and documentation articles but haven't been able to find anything yet." Then you haven't yet learned the correct usage of document: i.stack.imgur.com/RVvvv.gif
– xzczd
2 hours ago










2 Answers
2






active

oldest

votes

















up vote
5
down vote



accepted










In[5]:= FullForm[_.]

Out[5]= Optional[Blank]


See Optional and Blank.






share|improve this answer




















  • Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
    – Jmeeks29ig
    1 hour ago

















up vote
1
down vote













I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _. evaluates to Optional, at least when using ReplaceAll. An example will be better than words:



_, _. /. _Blank -> g


evaluates to:



g, Optional[g]


I know this is not a full answer, but hopefully it is at least partially helpful.






share|improve this answer




















    Your Answer




    StackExchange.ifUsing("editor", function ()
    return StackExchange.using("mathjaxEditing", function ()
    StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
    StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["$", "$"], ["\\(","\\)"]]);
    );
    );
    , "mathjax-editing");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "387"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: false,
    noModals: false,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f181826%2fwhat-does-mean-in-patterns%23new-answer', 'question_page');

    );

    Post as a guest






























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    5
    down vote



    accepted










    In[5]:= FullForm[_.]

    Out[5]= Optional[Blank]


    See Optional and Blank.






    share|improve this answer




















    • Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
      – Jmeeks29ig
      1 hour ago














    up vote
    5
    down vote



    accepted










    In[5]:= FullForm[_.]

    Out[5]= Optional[Blank]


    See Optional and Blank.






    share|improve this answer




















    • Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
      – Jmeeks29ig
      1 hour ago












    up vote
    5
    down vote



    accepted







    up vote
    5
    down vote



    accepted






    In[5]:= FullForm[_.]

    Out[5]= Optional[Blank]


    See Optional and Blank.






    share|improve this answer












    In[5]:= FullForm[_.]

    Out[5]= Optional[Blank]


    See Optional and Blank.







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered 1 hour ago









    Jason B.

    46k382176




    46k382176











    • Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
      – Jmeeks29ig
      1 hour ago
















    • Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
      – Jmeeks29ig
      1 hour ago















    Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
    – Jmeeks29ig
    1 hour ago




    Thanks! I'm still learning some of the basics, I should have thought to use FullForm :)
    – Jmeeks29ig
    1 hour ago










    up vote
    1
    down vote













    I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _. evaluates to Optional, at least when using ReplaceAll. An example will be better than words:



    _, _. /. _Blank -> g


    evaluates to:



    g, Optional[g]


    I know this is not a full answer, but hopefully it is at least partially helpful.






    share|improve this answer
























      up vote
      1
      down vote













      I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _. evaluates to Optional, at least when using ReplaceAll. An example will be better than words:



      _, _. /. _Blank -> g


      evaluates to:



      g, Optional[g]


      I know this is not a full answer, but hopefully it is at least partially helpful.






      share|improve this answer






















        up vote
        1
        down vote










        up vote
        1
        down vote









        I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _. evaluates to Optional, at least when using ReplaceAll. An example will be better than words:



        _, _. /. _Blank -> g


        evaluates to:



        g, Optional[g]


        I know this is not a full answer, but hopefully it is at least partially helpful.






        share|improve this answer












        I'm not sure if this fully answers the question I posted, but after some more searching, I have discovered that it seems like _. evaluates to Optional, at least when using ReplaceAll. An example will be better than words:



        _, _. /. _Blank -> g


        evaluates to:



        g, Optional[g]


        I know this is not a full answer, but hopefully it is at least partially helpful.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered 1 hour ago









        Jmeeks29ig

        3066




        3066



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmathematica.stackexchange.com%2fquestions%2f181826%2fwhat-does-mean-in-patterns%23new-answer', 'question_page');

            );

            Post as a guest













































































            Comments

            Popular posts from this blog

            Long meetings (6-7 hours a day): Being “babysat” by supervisor

            Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

            Confectionery