CoCoA:Source

From ApCoCoAWiki

Source

read commands from a file or device

Description

This command executes all CoCoA commands in the file or device named

S. A typical use of Source is to collect user-defined functions and

variables in a text file, say, MyFile.coc and then execute: <verbatim>

   Source "MyFile.coc";

</verbatim> or, equivalently, the obsolescent <verbatim>

   << "MyFile.coc";

</verbatim> Functions and variables read in from a file in this way will erase functions and variables with identical names that may already exist. This can be avoided by using packages. Repeatedly used functions can be read into CoCoA at start-up by using Source in the userinit.coc file.

Syntax

Source S:STRING

Introduction to IO

Introduction to Packages

User Initialization

Shortcuts

   <type>io</type>
   <type>printing</type>