JavaScript compatibility == Description == ~~ Client-side Hop can interact with JavaScript code easily. JavaScript (see ,( :class "href" "Hop and JavaScript" :onclick ~(jsref)) documentation) functions and variables can be used directly from Hop client-side code and vice-versa. In addition Hop and JavaScript share many object representation so that they can exchange values. Strings, numbers, functions are equivalent in both languages. ~~ In addition to blending Hop and JavaScript programs, some JavaScript builtin syntaxes are available from Hop by the means of functions. These functions can be used to avoid resorting on mixing Hop and JavaScript. This manual page describes these functions. == Synopsis == === Client === (js-for proc obj) (js-in? field obj) (js-instanceof? obj class) (js-property obj prop) (js-property-set! obj prop value) (js-property-delete! obj prop) (js-new class) (js-method-call obj method) == Examples == js-for, js-in?, js-instanceof?, js-new, js-method-call, js-property == Client Definitions == === ++(js-for proc obj)++ === js-for ^ arguments ^ type ^ short description ^ | proc | procedure | The procedure to apply to all the fields. | | obj | object | The object. | Apply ++proc++ to all ++obj++'s fields value. === ++(js-in? field obj)++ === js-in? ^ arguments ^ type ^ short description ^ | field | string | A field name. | | obj | object | An object. | Is ++field++ a field in ++obj++? === ++(js-instanceof? obj class)++ === js-instanceof? ^ arguments ^ type ^ short description ^ | obj | object | An object. | | class | procedure | A class constructor. | Is ++obj++ an instance of ++class++? === ++(js-property obj prop)++ === === ++(js-property-set! obj prop value)++ === === ++(js-property-delete! obj prop)++ === js-property js-property-set! js-property-delete! ^ arguments ^ type ^ short description ^ | obj | object | An object. | | prop | string | A property name. | | value | _ | Any value. | These functions get, set, and remove properties from objects. See ,( :class "href" "Hop and JavaScript" :onclick ~(jsref)) for examples. === ++(js-new class ...)++ === js-new ^ arguments ^ type ^ short description ^ | class | procedure | A class constructor. | Create a new JavaScript object. See ,( :class "href" "Hop and JavaScript" :onclick ~(jsref)) for examples. === ++(js-method-call obj method)++ === js-method-call ^ arguments ^ type ^ short description ^ | obj | object | An object. | | method | string | A method name. | Invokes ++method++ that belongs to ++obj++. See ,( :class "href" "Hop and JavaScript" :onclick ~(jsref)) for examples. == See also == js-for, js-in?, js-instanceof?, js-new, js-method-call, js-property