Reading LiveCode

We look at source code for a Transport Plugin service that converts an Audioboom url to a wiki page with five items of four types and a complete journal. github

We identify functions in the source and create folds here by the same name. Then we start reading from the bottom filling in notes for functions as we read them.

begin

Register index as the only service endpoint so far.

Using the easyjson library.

construct user paragraph

This recording was made near London, by fortyfoxes, on Dec 15, 2014 at 9:18 AM - audioboom

fetch clip json

guess clip json

Extract id from url.

Fetch clip json.

Extract audio clip array.

Construct audioboom page array.

Return json from array.

extract id from url

rest get

commands

Construct story audio array, etc.

Page array add to end.

* add audio to page array * add html to page array * add map to page array * add paragraph to page array

Commands to add a constructed item to the story and the journal. Called from page array add to end.

* add to end of index array * add to journal array

construct audioboom page array

Extract fields of audio clip array.

Construct new page array.

Add paragraph to page array.

Construct image div.

Add html to page array.

Add audio to page array.

Construct open street map description.

Add map to page array.

Construct user paragraph.

Add paragraph to page array.

construct factory array

construct image div

construct journal array

construct new page array

Set page title.

Add paragraph to page array.

Construct journal array.

construct open street map description

construct story audio array

construct story html array

construct story map array

construct story paragraph array

page array add to end

Add to end of index array.

Add to journal array.

file deconstruct command

kwote

sha1 hash

url deconstruct command

json from array

json to array

construct error json

index command

Extract dropped url from $_POST_RAW.

Generate some json with guess clip json.

Output headers and some json.

.

I was impressed that the service transported complete wiki pages, modeled after similar Audioboom pages, ready to be forked into their new destination. I had expected a page of boiler plate with one audio item to be copied elsewhere.

I was surprised that the page included a complete journal. Adding factories and then editing them to the desired item creates more journal than required. However adds do require unfortunate logic to create a sequence since the default placement is at the beginning of the story. github

Reading and writing about LiveCode with GitHub on the left and Federated Wiki on the right.

Some call paths seem out of order. Add paragraph to page array could be a late addition as the internal complexity of the journal surfaced in the design.

I've invested two hours reading and now understand the LiveCode abstractions as applied to transporting. The functions have been systematically named and easily converted to my own notes as you see here.

Tip: Open the last revision of this page. Then shift-hover over each action below to see my approach to reading and appreciating an unfamiliar program in a long forgotten language. Serious reading starts about halfway through the journal.