-
Book Overview & Buying
-
Table Of Contents
Learn Bosque Programming
By :
Bosque, like most programming languages, allows us to explicitly establish the start of execution of a program through an entrypoint function. In this section, we will learn how to write one.
In Bosque, the entrypoint function is defined by default as a function named main(), which must be placed within the NSMain namespace, as follows:
namespace NSMain;
entrypoint function main(): String {
return "Hello World, from an Entry Point ";
}
When compiling this code, a binary is generated where the first instruction to be executed will be a call to the main function, and after running it we will be able to see the message "Hello world, from an Entry Point" in our console.
It is possible to define some other function through the entrypoint keyword or even define more than one. This is useful for symbolic testing through a data-driven strategy or when we want to program with different...