Skip to main content
Glama
emicklei

melrōse musical expression player

by emicklei
repeat.go825 B
package op import ( "bytes" "fmt" "github.com/emicklei/melrose/core" ) type Repeat struct { Target []core.Sequenceable Times core.HasValue } func (r Repeat) S() core.Sequence { times := core.Int(r.Times) repeated := []core.Sequenceable{} for i := 0; i < times; i++ { for _, each := range r.Target { repeated = append(repeated, each.S()) } } return Join{Target: repeated}.S() } func (r Repeat) Storex() string { var b bytes.Buffer fmt.Fprintf(&b, "repeat(%s", core.Storex(r.Times)) core.AppendStorexList(&b, false, r.Target) fmt.Fprintf(&b, ")") return b.String() } // Replaced is part of Replaceable func (r Repeat) Replaced(from, to core.Sequenceable) core.Sequenceable { if core.IsIdenticalTo(r, from) { return to } return Repeat{Target: replacedAll(r.Target, from, to), Times: r.Times} }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/emicklei/melrose'

If you have feedback or need assistance with the MCP directory API, please join our Discord server