Skip to content

String Literal

IsaacShelton edited this page Nov 13, 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.7/String.adept or 2.7/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