Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Mata and semicolon


From   "Sergiy Radyakin" <[email protected]>
To   "[email protected]" <[email protected]>
Subject   st: Mata and semicolon
Date   Mon, 27 Oct 2008 19:18:03 -0400

Dear All,

the following document recommends not using semicolon (;) delimiter in Mata:
"We recommend that you do not use Mata when Stata is in #delimit ;
mode. Mata will not mind, but you will confuse yourself."
              http://www.stata.com/help.cgi?m2_semicolons

Why does Mata complain in the following example? (see
"mata_des_bug.do" below). Who is confused, me or Mata?
(happens for mata des followed by ; and for mata mosave followed by ;)

Thank you,
   Sergiy Radyakin



/* --- begin of mata_des_bug.do ------ */

   /* 1. This part works */
   #delimit cr
   mata mata clear
   mata
     void function foobar() {
       1
     }
     mata des
   end

   mata: foobar()

   /* 2. This part does not work */
   #delimit ;
   mata mata clear;
   mata;
     void function foobar() {;
       2;
     };
     mata des ;
   end;

   mata: foobar();

/* --- end of mata_des_bug.do ------ */
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index