Delegation can be accounted for by making the delegate references into caller references, and adding an indirection to the call of the delegated actualization so that the caller now matches the intended delegate.
For example
node_modules/* |
<jstp bind="message/*@localhost:.post"> | |
<p><strong>{{message.author}}</strong> <span>{{message.text}}</span></p> | |
</jstp> | |
<p>There are <jstp bind="humanity/total@statistics.com:.put"></jstp> humans on Earth, and counting</p> |
You have a file named "greet.js" with the following code:
module.exports = function (name) {
console.log("Hi " + name);
}
Then you run:
Just a quick example
action: {
argument: ø
print(argument)
result: +(argument, argument)
}
action: {
// sudo npm install -g washington | |
// npm install mathjs | |
// washington index | |
var math = require("mathjs") | |
math.type.Matrix.prototype.toString = function () { | |
var string = " ┌ " | |
for (var i = 0; i < this.size()[1]; i ++) | |
string += " " | |
string += "┐" | |
this.forEach((function (value, index) { |
// Naming an otherwise anonymous function creates the named reference inside the | |
// function's scope. We use `cache` as the internal name | |
var selfMemoizing = function cache(input) { | |
// Let's prepare a cache object called "memoize" if not available | |
cache.memoized = cache.memoized || {} | |
// Return the cached result if available | |
if (cache.memoized[input]) return cache.memoized[input] | |
var wildcardProperty = (function (match) { | |
return function (value) { | |
return { | |
value: value, | |
match: match | |
} | |
} | |
})(function (object) { | |
for (key in object) if (object[key] === this.value) return true |
It is quite easy to describe an HTTP API:
GET /users/:id
An HTTP verb and a pattern of the path it’s all that is required. We call that conjunction an endpoint
. Although the name is older than REST, and was in use for XML-RPC and SOAP web services, REST has clearly brought it to the mainstream.
jstp:GET//localhost:80//google.com:8080/books,timestamp:<number> | |
jstp:GET | |
jstp:POST | |
jstp:PUT | |
jstp:PATCH | |
jstp:DELETE | |
jstp:BIND |