Repository navigation
0.31.0
Agentica 0.31.0 is the first stable release since 0.30.1. It includes the changes of 0.31.0-alpha.1.
Highlights:
- Lambdas:
->(x) { x + 1 }is a function value, and a pipe step may name a method of the value:xs |> map(f) |> sum(). - Named arguments for any function,
std/function or builtin:check(gen, verbose: true). - Errors have a type: a failed Result holds an
Errorwith a kind, message, code, details, cause and location.error("unique failed", kind: "db.constraint", code: 19)builds one ande.is_a?("db")matches a family of kinds. Builtins andstd/report kinds such asio.not_found,net.timeout,http.too_largeanddenied.fs. private: aprivateline in a file or module block makes the declarations after it private, and in a struct body makes the fields after it private to the module (the struct is built only there).agentica = "0.31.0"inagentica.tomlnames the oldest Agentica a project or package needs.- Builtin types live under their module:
File.Info,TCP.Socket,TLS.Context,Test.Case,JSON.Value,HTTP.Request. agentica lint,refsandtype-atunderstand named arguments and error kinds.
Breaking changes:
exportbefore a declaration is a parse error. A declaration is public unless it comes afterprivate: delete theexport, and putprivatebefore the declarations you want to hide.export Alias.namestill re-exports.- A file with no
privateis public as a whole (it exported only what it marked before): addprivatebefore what you want to hide. Animportafter a re-export isCHECK-DECL-ORDER: move the imports above it. - Builtin and
std/errors have kinds, and==witherror("same text")no longer holds. Branch one.kindore.is_a?("io"), not on the message. error(e)in acasebinds anError, not a String: writee.message.- A refused
--deny-*or--sandboxcall returns the kinddenied.env,denied.fs,denied.netordenied.run, noterror. - Old type names are unknown: write
JSON.ValueandJSON.Field(notJson,JsonField),File.Info,File.Handle,Process.Output,TCP.Socket,TCP.Listener,TLS.Context,TLS.ClientOptions,TLS.ServerOptions,Test.Case, andSystem.Profile.measure/System.Profile.steps. - From the alpha: a builtin has only its Ruby name (
strip,to_i,list.join, ...); the HTTP types areHTTP.Request,HTTP.Response,HTTP.Header,HTTP.ClientOptions,HTTP.ServerOptions,HTTP.ClientandHTTP.Server;Erroris a reserved type name; nothing chains after theendof adoblock (use braces);agentica test --jobs Nruns the scenarios of one file as separate jobs (use--jobs 1when they share a port, a path or a DB); the child channel ofProcess.spawn_channelis a pipe per direction.
Full list: CHANGELOG.
The archives are not signed or notarized.