All pastes #747934 Raw Edit

another meta function struct

public javascript v1 · immutable
#747934 ·published 2007-10-24 13:42 UTC
rendered paste body
func = {    '|': {        description: 'OR operator',        head: ['$1', '|', '$2'],         tail: ['|', '$1'],        headArgs: [            {title: null, type:'Any'},             {title: null, type:'Any'}        ],        tailArgs: [            {title: null, type:'Any'}        ],        ret: 'Boolean',        tags: ['Operators']    },    'pi': {        description: 'Math PI function',        head: ['pi()'],        tail: [],        headArgs: [],        tailArgs: [],        ret: 'Number',        tags: ['Math']    },    '[.:.]': {        description: 'Extract a substring (left, right)',        head: ['$1', '[', '$2', ':', '$3', ']'],        tail: []        headArgs: [            {title: 'source', type: 'String'},             {title: 'start', type: 'Number'},            {title: 'end', type: 'Number'}        ],        tailArgs: [],        ret: 'String',        tags: ['String functions']    },    'substr': {        description: 'Extract a substring (left, size)',        head: ['$1', '.substr(', '$2', [',', '$3'], ')'],        tail: []        headArgs: [            {title: 'source', type: 'String'},             {title: 'left', type: 'Number'},            {title: 'size', type: 'Number'}        ],        tailArgs: [],        ret: 'String',        tags: ['String functions']    }}