github.com/lmorg/murex@v0.0.0-20240217211045-e081c89cd4ef/docs/commands/method.md (about)

     1  # `method`
     2  
     3  > Define a methods supported data-types
     4  
     5  ## Description
     6  
     7  `method` defines what the typical data type would be for a function's STDIN
     8  and STDOUT.
     9  
    10  ## Usage
    11  
    12  ```
    13  method: define name { json }
    14  ```
    15  
    16  ## Examples
    17  
    18  ```
    19  method: define name {
    20      "Stdin":  "@Any",
    21      "Stdout": "json"
    22  }
    23  ```
    24  
    25  ## Detail
    26  
    27  ### Type Groups
    28  
    29  You can define a Murex data type or use a type group. The following type
    30  groups are available to use:
    31  
    32  ```go
    33  package types
    34  
    35  // These are the different supported type groups
    36  const (
    37  	Any               = "@Any"
    38  	Text              = "@Text"
    39  	Math              = "@Math"
    40  	Unmarshal         = "@Unmarshal"
    41  	Marshal           = "@Marshal"
    42  	ReadArray         = "@ReadArray"
    43  	ReadArrayWithType = "@ReadArrayWithType"
    44  	WriteArray        = "@WriteArray"
    45  	ReadIndex         = "@ReadIndex"
    46  	ReadNotIndex      = "@ReadNotIndex"
    47  	ReadMap           = "@ReadMap"
    48  )
    49  
    50  // GroupText is an array of the data types that make up the `text` type
    51  var GroupText = []string{
    52  	Generic,
    53  	String,
    54  	`generic`,
    55  	`string`,
    56  }
    57  
    58  // GroupMath is an array of the data types that make up the `math` type
    59  var GroupMath = []string{
    60  	Number,
    61  	Integer,
    62  	Float,
    63  	Boolean,
    64  }
    65  ```
    66  
    67  ## See Also
    68  
    69  * [Interactive Shell](../user-guide/interactive-shell.md):
    70    What's different about Murex's interactive shell?
    71  * [`->` Arrow Pipe](../parser/pipe-arrow.md):
    72    Pipes STDOUT from the left hand command to STDIN of the right hand command
    73  * [`alias`](../commands/alias.md):
    74    Create an alias for a command
    75  * [`autocomplete`](../commands/autocomplete.md):
    76    Set definitions for tab-completion in the command line
    77  * [`function`](../commands/function.md):
    78    Define a function block
    79  * [`private`](../commands/private.md):
    80    Define a private function block
    81  * [`runtime`](../commands/runtime.md):
    82    Returns runtime information on the internal state of Murex
    83  
    84  <hr/>
    85  
    86  This document was generated from [builtins/core/structs/function_doc.yaml](https://github.com/lmorg/murex/blob/master/builtins/core/structs/function_doc.yaml).