All pastes #748048 Raw Edit

another meta function struct

public javascript v1 · immutable
#748048 ·published 2007-10-24 15:25 UTC
rendered paste body
func = {    'array': {        description: 'Array constructor',        head: ['array(', '$1', [',', '$1'], ')'],         headArgs: [            {title: null, type:'Same'}        ],        tailArgs: [            {title: null, type:'Same'}        ],        ret: 'Array',        tags: ['Array Functions']    },    '|': {        description: 'OR operator',        head: ['$1', '|', '$2', ['|', '$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()'],        headArgs: [],        tailArgs: [],        ret: 'Number',        tags: ['Math']    },    '[.:.]': {        description: 'Extract a substring (left, right)',        head: ['$1', '[', '$2', ':', '$3', ']'],        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'], ')'],        headArgs: [            {title: 'source', type: 'String'},             {title: 'left', type: 'Number'},            {title: 'size', type: 'Number'}        ],        tailArgs: [],        ret: 'String',        tags: ['String functions']    }}