extensions

package
v0.49.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 12 Imported by: 2

Documentation

Overview

Package mappings some go built in functions to grol functions. Same mechanism can be used to map other go functions to grol functions and further extend the language.

Index

Constants

View Source
const GrolFileExtension = ".gr" // Also the default filename for LoadSaveEmptyOnly.

Variables

This section is empty.

Functions

func Init

func Init(c *Config) error

Init initializes the extensions, can be called multiple time safely but should really be called only once before using GROL repl/eval. If the passed Config pointer is nil, default (safe) values are used.

Types

type Config added in v0.41.0

type Config struct {
	HasLoad           bool // load() only present if this is true.
	HasSave           bool // save() only present if this is true.
	LoadSaveEmptyOnly bool // Restrict load/save to a single .gr file inside the current directory.
	UnrestrictedIOs   bool // Dangerous when true: can overwrite files, read any readable file etc...
}

Configure restrictions and features. Currently about IOs of load and save functions.

type OneFloatInOutFunc

type OneFloatInOutFunc func(float64) float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL