﻿<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="thpdoc.xsl"?>
<page id="using" suffix=" Keyword">
  <subsection>References a namespace.<code>using NamespaceName;</code></subsection>
  The <kw>using</kw> statement specified in a source file allows referencing classes, entities and functions declared in the namespace without specifying the namespace name every time. Its behavior is fully equivalent to the <kw>using</kw> statement in C#.
  E.g. the following 4 code snippets are equivalent:
  <code>entity Test
{
	Core.Primitives.FIFO&lt;32, 512&gt; FIFO1(...);
}</code>
  <code>using Core;
entity Test
{
	Primitives.FIFO&lt;32, 512&gt; FIFO1(...);
}</code>
  <code>using Core.Primitives;
entity Test
{
	FIFO&lt;32, 512&gt; FIFO1(...);
}</code>
  <code>using Core.Primitives;
entity Test
{
	Core.Primitives.FIFO&lt;32, 512&gt; FIFO1(...);
}</code>

  <section name="Remarks">
	<p>Note that the <kw>using</kw> statement can be specified anywhere inside the root scope of the file (e.g. placing a <kw>using</kw> statement inside an <kw>entity</kw> declaration would result in an error message). However, it is recommended to place <kw>using</kw> statements in the beginning of the file to improve readability.</p>
  </section>
  <seealso id="namespace"/>
</page>