nce you could have interfaces Sequence and FiniteSequence defined with
> the same set of methods, except that FiniteSequence has an extra dummy
> method like ReallyIsFinite(). It's never called, but is implemented by
> FiniteNumber and not Number, for type checking purposes only.
>
> On
I have published this
module: https://pkg.go.dev/github.com/keep94/sqroot/v2 for analysing square
roots and cube roots. The module works, but it is easy to write code that
will run forever. For example in v2:
// Print the position of the last 7 in the square root of 2. Oops, the
square root
I have this package: https://pkg.go.dev/github.com/keep94/sqroot, which
computes square roots to arbitrary precision. The Number type is a value
type that represents a square root value. Early on it made sense to make
Number be an immutable value type because it represents an immutable value
The type I am writing can be easily encoded as a sequence of ints. When I
wrote MarshalBinary for my type, I decided to GobEncode this sequence of
ints to a byte buffer and return the bytes. I learned that GobEncoding an
empty slice of int takes 18 bytes. So even for small instances of my
I am working on a Pipeline[T, U any] type which receives any number of T
values and in turn emits U values. Pipelines are used to read from
databases.
For instance, this code fetches the ages of 5 people under 50.
int[] ages
PeopleOrderedByName(Start[Person]().
Map(func(p Person) int {
I created github.com/keep94/consume2 which is a rewrite of
github.com/keep94/consume using Go generics. However, the new package is
not showing up in pkg.go.dev. I am wondering if pkg.go.dev is set up to
understand generics?
--
You received this message because you are subscribed to the
This may be silly question, but is there a way for me to download and play
with 1.18 while keeping my existing 1.17 installation for production code?
Is there a way to have multiple versions of go installed on the same
computer?
--
You received this message because you are subscribed to the
I recently checked in a new version of github.com/keep94/birthday on 12
June. pkg.go.dev sees this new version, yet pkg.go.dev insists that the
"latest" version is the one I checked in on the 11 June.
The version that I want to be the latest is:
v0.0.0-20210612031622-805d2048defa
Recently I implemented a heap in GO. To implement a heap, you have to
implement Push() and Pop() as well as the 3 methods for sort: Less(),,
Swap(), and Len(). For my heap, I never had to Push or Pop, I only had to
initialize the heap and repeatedly "Fix" the top element of the heap. As
it
I am writing this to see what everyone thinks about a solution I have for
the composite pattern.
The composite pattern is when 0 or more instances of some interface X can
act together as a single instance of interface X. For instance you may have
a Filter interface that filters instances of
I've been working on a math library github.com/keep94/gomath. This library
has functions for generating prime numbers, ugly numbers, harshad numbers,
happy numbers etc. Since there are infinitely many prime numbers, ugly
number, harshad numbers etc, these functions I wrote returned either a
Somebody I depend on for my project made a breaking change to their git
repo and broke my build.
I found that if I simply revert their latest commit locally that my project
builds.
I don't necessarily want to vendor everything because most of the libraries
I use I trust. But I do want to
12 matches
Mail list logo