Skip to content

Commit

Permalink
added Extendf
Browse files Browse the repository at this point in the history
  • Loading branch information
lunfardo314 committed Feb 10, 2024
1 parent a45f8c3 commit eaad170
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions library.go
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,14 @@ func (lib *Library) Extend(sym string, source string) uint16 {
return ret
}

func (lib *Library) Extendf(sym string, template string, args ...any) uint16 {
ret, err := lib.ExtendErr(sym, fmt.Sprintf(template, args...))
if err != nil {
panic(err)
}
return ret
}

func makeEvalFunForExpression(sym string, expr *Expression) EvalFunction {
return func(par *CallParams) []byte {
varScope := make([]*call, len(par.args))
Expand Down

0 comments on commit eaad170

Please sign in to comment.