In a prosecution for attempted premeditated murder as well as various other offenses, denial of a writ of mandate challenging a finding that the trial court was authorized to order petitioner to submit himself to a prosecution expert for purposes of mental examination is reversed where: 1) mental examination is a form of discovery subject to the criminal discovery statutes; 2) nothing in the criminal discovery statutes authorizes a trial court to issue an order granting access to petitioner for mental examination by an expert retained by the prosecution; 3) an issue regarding Evidence Code section 730 was not preserved for appeal; 4) section 1054.4 was inapplicable because statements obtained in the type of mental examination sought are testimonial; 5) the Constitution does not mandate that the trial court grant access to petitioner for purposes of a mental examination by a prosecution expert on the ground that petitioner intends to raise a "diminished actuality" defense; and 6) the government's rights under due process were not violated by denying access to petitioner.