[View]  [Edit]  [Lock]  [References]  [Attachments]  [History]  [Home]  [Changes]  [Search]  [Help] 

[pi8] Loading the Cylon Framework

The Cylon Framework is a set o S8 classes to access Cylon.js from your system.
The famework can be loaded on demand from U8 service.

The sources of the framework are located here.

Loading the famework dynamically

Evaluate the following expression to load the framework from U8 service
| url str callback |
url := 'http://u8.smalltalking.net/profile/aleReimondo/RaspberryPi/Cylon.st.js'.
callback := [:res||response|
	response := NodeHTTPClientResponse @ res.
	response statusCode = 200 ifFalse: [
		self error: 'File not found ',url
	str := ''.
	  on: #data do: [:chunk| str := str , chunk ];
	  on: #end do: [ Compiler new eval: str ]
(NodeJS http
	request: url
	with: callback) end

Check the framework has loaded

Open a SystemBrowser to find the Cylon class
or... try to evaluate in a workspace Cylon class>>#robot: