Releases: jcburley/joker
Support Go 1.19
Full Changelog: gostd-v0.18...gostd-v0.19
Support Joker 1.1.0
Full Changelog: gostd-v0.17...gostd-v0.18
Support Joker 1.0.1
Full Changelog: gostd-v0.16...gostd-v0.17
Support Go 1.18beta1
There's no support for generics per se in this release; mostly just recognizing any
as an alias for interface{}
.
Full Changelog: gostd-v0.15...gostd-v0.16
Support Joker 0.18.0
Full Changelog: gostd-v0.14...gostd-v0.15
Support methods defined on embedded types, rename 'refTo' to '*', etc.
Many methods, available to Go code via types embedded in interfaces and structs, are now also made available to Joker code. E.g. (.Close c)
on a net.TCPConn
connection c
now works, even though TCPConn
itself does not implement Close
, because its struct embeds the (non-exported) net.conn
type, which does implement Close
. Note that gostd
tries to avoid wrapping a method, available via an embed, that is explicitly implemented by the containing type. For example, text/template/parse.DotNode
is a struct that embeds NodeType
, for which the Type()
method is defined; but, since DotNode
implements its own Type()
, that method, not NodeType
's, is left as the wrapped type for e.g. (.Type d)
, where d
is typeDotNode
.
A value receiver for a reference (wrapped by a GoObject
) can now be called without having to explicitly dereference the object. Some support for calling a pointer receiver for a value is now provided, but doesn't work in the straightforward case of a GoObject
wrapping that value, as the Go runtime (specifically, the reflect
package) does not always see such a value as capable of being addressable (reflect.CanAddr()
fails).
Pointer types are named using *
, instead of refTo
, as *
is a reasonably common character in Clojure symbols. However, as [
and ]
are not valid (without escaping in some fashion), arrays/slices are still named using arrayOf
, leading to some bodges such as arrayOf*Foo
. It's unclear whether any elegant solution to this problem exists.
Preliminary support for func()
types (taking no arguments and returning no value) is provided. However, it's purely experimental, and no attempt is made to ensure single-threading behavior with respect to other running Joker code. As the only test case currently defined invokes the function on a separate thread from the main thread passing the function, it's either happenstance, or the very limited use case of the Joker code that implements the function, that allows that test case to pass.
Substantial refactoring of gostd
continues with this preliminary release, but much more is planned, some of which will likely be visible to Joker code calling the wrapped namespaces.
Implement set!; EOL GoVar's, ref, and some var functionality
The (set! ...)
special form is implemented, and supersedes use of (var ...)
on field references. E.g. instead of (var-set (var (.member instance)) value)
, use (set! (.member instance) value)
, which is much more Clojure-like.
The GoVar
object no longer exists. Variables are now implemented as GoObject
s that wrap references (pointers) to the respective variables, with automatic derefencing for ordinary usage. So, SomeVar
yields a snapshot of the SomeVar
variable; now, (set! SomeVar new-value)
is used to change the value of the variable, and (set! (.SomeField SomeVar) new-value)
to change the value of a specific field when SomeVar
is a struct
. ((deref SomeVar)
, aka @SomeVar
, no longer work on global variables as previously described for earlier versions of this fork. Similarly, (var (...))
is no longer supported.)
The ref
function (in joker.core
) has been removed, as it was not similar enough to Clojure's ref
. A replacement function (or possibly a special form) is being contemplated for a future release.
Values of type error
are now wrapped in GoObject
s instead of being converted into String
s. This allows receivers for those values to be invoked, and is consistent with preserving the native type when not precisely implemented by a Joker type (in this case, Error
, an abstract type). When an error
type is needed, the supplied expression may be String
or GoObject[error]
.
Merge in the GoType->Type Change
This actually does what gostd-v0.12
claimed to do, which is good.
Support Joker 0.17.0, Replace `GoType` With `Type`
This release dispenses with one of the "special" Object
types, GoType
, instead creating Joker Type
objects, which are now a bit heavier-weight (they support constructors and lists of methods and receivers, though none of the builtin Joker types do any of that yet) in order to support the features that GoType
previously supported.
Mostly, this just makes understanding gostd
a bit easier, as well as the code base somewhat simpler.
Support Clojure's "dot" (., .member, type., ..) special forms/macros
While (. instance field)
returns the value of the field, instead of using (set! ...)
to change it (as that's not yet supported), use (var ...)
to return a GoVar
for the field (the field's value itself is not retrieved). Then use (deref ...)
on the resulting GoVar
to obtain the value, or (var-set ...)
to set it.