Fork me on GitHub
#joker
<
2021-03-24
>
jcburley19:03:57

Hmm, these release URLs don't seem to get unfurled by Slack, so here's a manual unfurling of sorts: https://github.com/jcburley/joker/releases/tag/gostd-v0.9 Repository: https://github.com/jcburley/joker · Tag: https://github.com/jcburley/joker/tree/gostd-v0.9 · Commit: https://github.com/jcburley/joker/commit/f9c370699c7c9b7385b2c93fd90cb08d27aec853 · Released by: https://github.com/jcburley This release wraps most (90% or more) functions, provides constructors for most defined types, and supports many useful operations. For example, this version of Joker can send emails via SMTP. Much still needs to be done; see the docs for a partial list. Meanwhile, here are some highlights (from GOSTD.md) of what's new: ... arguments are now supported for functions, methods, and receivers, unless the underlying type is any other type Joker decides to pass by reference (currently these are all non-empty struct{} types; as a result, reflect.Append() is unsupported). E.g.:

user=> (go.std.fmt/Println ( 1 2 3 4) ( 255 255 255 127))
1.2.3.4 ffffff7f
[17 nil]
user=>
^GoObject arguments are extended to support many native Joker types via their underlying (`Native`) types. E.g.:
user=> (go.std.fmt/Println 1 2 3 4)
1 2 3 4
[8 nil]
user=>
[]byte arguments and fields are now supported in function calls and ctors, and also support automatic conversion from strings (e.g. an object of type String). There are more conversions like this to come, but this is a nice proof-of-concept, as it enables (for example) sending an email to an SMTP server. A Vector or Seq may be provided in lieu of a String (this might be too general!). E.g.:
user=> (go.std.fmt/Printf [65 66 67 10])
ABC
[4 nil]
user=>
Got chan and (empty) struct{} types working at a rudimentary level. Receivers that have no return values are now implemented; their Joker wrappers return NIL, just as for regular functions and methods. Types defined (recursively) in terms of builtin types are now pass-by-value (and construct-by-value), as is struct{}. Note that constructors for pass-by-reference types return reference types. E.g. (new Foo ...) returns refToFoo. Assuming the Go code defines methods on *Foo, they should work on the result; else, one should be able to dereference and then invoke them, as in (Go (deref my-foo) :SomeMethod ...). Though some namespaces redefine (shadow) built-in types such as String and Error, (catch <type> ...) now first checks type to see whether it is a symbol that names one of the built-in types (and does not specify a namespace). If so, that type is used, rather than an error resulting.

jcburley19:03:57

Hmm, these release URLs don't seem to get unfurled by Slack, so here's a manual unfurling of sorts: https://github.com/jcburley/joker/releases/tag/gostd-v0.9 Repository: https://github.com/jcburley/joker · Tag: https://github.com/jcburley/joker/tree/gostd-v0.9 · Commit: https://github.com/jcburley/joker/commit/f9c370699c7c9b7385b2c93fd90cb08d27aec853 · Released by: https://github.com/jcburley This release wraps most (90% or more) functions, provides constructors for most defined types, and supports many useful operations. For example, this version of Joker can send emails via SMTP. Much still needs to be done; see the docs for a partial list. Meanwhile, here are some highlights (from GOSTD.md) of what's new: ... arguments are now supported for functions, methods, and receivers, unless the underlying type is any other type Joker decides to pass by reference (currently these are all non-empty struct{} types; as a result, reflect.Append() is unsupported). E.g.:

user=> (go.std.fmt/Println ( 1 2 3 4) ( 255 255 255 127))
1.2.3.4 ffffff7f
[17 nil]
user=>
^GoObject arguments are extended to support many native Joker types via their underlying (`Native`) types. E.g.:
user=> (go.std.fmt/Println 1 2 3 4)
1 2 3 4
[8 nil]
user=>
[]byte arguments and fields are now supported in function calls and ctors, and also support automatic conversion from strings (e.g. an object of type String). There are more conversions like this to come, but this is a nice proof-of-concept, as it enables (for example) sending an email to an SMTP server. A Vector or Seq may be provided in lieu of a String (this might be too general!). E.g.:
user=> (go.std.fmt/Printf [65 66 67 10])
ABC
[4 nil]
user=>
Got chan and (empty) struct{} types working at a rudimentary level. Receivers that have no return values are now implemented; their Joker wrappers return NIL, just as for regular functions and methods. Types defined (recursively) in terms of builtin types are now pass-by-value (and construct-by-value), as is struct{}. Note that constructors for pass-by-reference types return reference types. E.g. (new Foo ...) returns refToFoo. Assuming the Go code defines methods on *Foo, they should work on the result; else, one should be able to dereference and then invoke them, as in (Go (deref my-foo) :SomeMethod ...). Though some namespaces redefine (shadow) built-in types such as String and Error, (catch <type> ...) now first checks type to see whether it is a symbol that names one of the built-in types (and does not specify a namespace). If so, that type is used, rather than an error resulting.