Statalist


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

Re: st: Mata and semicolon


From   Maarten buis <maartenbuis@yahoo.co.uk>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Mata and semicolon
Date   Tue, 28 Oct 2008 07:32:43 +0000 (GMT)

This works: 

/* --- begin of mata_des_nobug.do ------ */
   #delimit ;
   mata mata clear;
   mata;
     void function foobar() {
       2
     }
     mata des 
   end

   mata: foobar();
/* --- end of mata_des_nobug.do ------ */

Once you are within Mata the semicolon is no longer the delimiter.

-- Maarten

--- Sergiy Radyakin <serjradyakin@gmail.com> wrote:

> 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/
> 


-----------------------------------------
Maarten L. Buis
Department of Social Research Methodology
Vrije Universiteit Amsterdam
Boelelaan 1081
1081 HV Amsterdam
The Netherlands

visiting address:
Buitenveldertselaan 3 (Metropolitan), room N515

+31 20 5986715

http://home.fsw.vu.nl/m.buis/
-----------------------------------------


      
*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index