/* Variable (Rosetta code) in Picat. http://rosettacode.org/wiki/Variables """ Demonstrate a language's methods of: - variable declaration - initialization - assignment - datatypes - scope - referencing, and - other variable related facilities """ Se Prolog for a long comment on Prolog! This program was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ % import v3_utils. % import util. % import cp. main => go. % cf Prolog % - no declaration of a variable is needed % a variable can take any type of value % and can re-assigned to any type of value go ?=> X = 2, % assignment X := 3, % re-assignment S = "string", N = 123, % number C = 'c', % character nl. go => true.