Skip to content

String Literal

IsaacShelton edited this page Mar 21, 2022 · 3 revisions

String Literal

String literals are strings surrounded with double quotes:

“Hello World”
“John”
“Welcome, Isaac Shelton.”

Requirements

In order to create String literals, the types String and StringOwnership must defined.

In order to satisfy these requirements, you can do one of the following:

  • Import 2.6/String.adept or 2.6/basics.adept
  • Declare your own version of the String type (deprecated)

Ownership

String literals are references to constant global memory, and therefore have the StringOwnership::REFERENCE ownership.

They should NEVER be modified without first making a copy via make() or clone().

Clone this wiki locally