Download PDF Version
Transcript
on the same device (platform), hence its name, but it can also be used for access
to fields shared by other bundles.
Here we present a simple example using hardwired IP address, but actual device
addresses should not normally appear in the source code: they should be supplied
during re-hydration:
def bundle simplelink()
{
pebble my_keyboard = Pebbles#Front_panel#Keyboard;
pebble your_devices = tup://128.232.1.10/Pebbles#Devices;
// field declarations omitted
your_devices#front_panel#on_led := my_keyboard#on_switch;
}
Pebble aliases can be defined inside a bundle statement (as shown) or outside.
5.8
Pragmas
The ‘pragma’ statment enables control flags to be passed to the compiler. These
may occur inside a bundle declaration or at the top level of a file. See the compiler
manual for details of the supported pragmas.
5.9
Operators
The operators available at source level include all those defined in for object level
in §4.3. Each is denoted with its usual symbol or digraph.
In addition, the differentiate operator is provided, denoted with uparrow ( ↑ exp).
The currently available forms are summarised in Figure 5.1.
It is our goal to support as many features found in common OO imperative HLLs
as possible, while still producing output that can be represented as Pushlogic object rules and checked automatically at load time.
5.9.1 Function Call
Function calls are expanded fully at compile time and so must be have statically
bounded recursion.
50