MCPcopy Create free account
hub / github.com/abs-lang/abs / String

Struct String

object/object.go:213–222  ·  view source on GitHub ↗

The String is a special fella. Like ints, or bools, you might think it will only have a Value property, the string itself. TA-DA! No, we also have an Ok and Done properties that are used when running shell commands -- since the shell will return strings. So, look at this: cmd = `ls -la` type(cmd

Source from the content-addressed store, hash-verified

211// cmd.wait() // ...
212// cmd.done // TRUE
213type String struct {
214 Token token.Token
215 Value string
216 Ok *Boolean // A special property to check whether a command exited correctly
217 Cmd *exec.Cmd // A special property to access the underlying command
218 Stdout *bytes.Buffer
219 Stderr *bytes.Buffer
220 Done *Boolean
221 mux *sync.Mutex
222}
223
224func (s *String) Type() ObjectType { return STRING_OBJ }
225func (s *String) Inspect() string { return s.Value }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected