goalheap

command
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2025 License: ISC Imports: 7 Imported by: 0

README

The main.go file gives an example of how to extend the default interpreter with new builtins. The current example provides builtins handling a simple minheap-based mutable priority queue. Note that it's just provided as an example and so may be updated (it is not part of stable API), so you may want to work on a local copy if you plan on using it for anything serious.

It can be build and installed in a similar way as the default interpreter using either go build or go install in this directory.

Exported:

heapq.new()        / initialize and return new priority queue
heapq.push[pq;x;i] / push x with integer piority i
heapq.pop[pq]      / remove and return lowest priority item
heapq.pop2[pq]     / remove and return lowest priority item and priority
heapq.len[pq]      / number of elements in the queue

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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