1"use strict";(self.webpackChunkmodular_fe=self.webpackChunkmodular_fe||[]).push([["13888"],{68146(e,n,s){s.r(n),s.d(n,{assets:()=>l,contentTitle:()=>d,default:()=>a,frontMatter:()=>o,metadata:()=>r,toc:()=>c});var r=s(180),i=s(74848),t=s(28453);let o={title:"Mojo v0.6.1",date:new Date("2023-12-18T00:00:00.000Z")},d,l={authorsImageUrls:[]},c=[{value:"\u2B50\uFE0F New",id:"\uFE0F-new",level:2},{value:"\u{1F98B} Changed",id:"-changed",level:2},{value:"\u{1F6E0}\uFE0F Fixed",id:"\uFE0F-fixed",level:2}];function h(e){let n={a:"a",code:"code",h2:"h2",li:"li",p:"p",pre:"pre",ul:"ul",...(0,t.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"\uFE0F-new",children:"\u2B50\uFE0F New"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The Mojo REPL now provides limited support for the ",(0,i.jsx)(n.code,{children:"%cd"})," magic command."]}),"\n",(0,i.jsx)(n.p,{children:"This command automatically maintains an internal stack of directories you\nvisit during the REPL session. Usage:"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"%cd 'dir'"}),": change to directory ",(0,i.jsx)(n.code,{children:"dir"})," and push it on the directory stack."]}),"\n",(0,i.jsxs)(n.li,{children:[(0,i.jsx)(n.code,{children:"%cd -"}),": pop the directory stack and change to the last visited directory."]}),"\n"]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Structs decorated with ",(0,i.jsx)(n.code,{children:"@value"})," now automatically conform to the\n",(0,i.jsx)(n.a,{href:"/docs/std/traits/movable/Movable/",children:(0,i.jsx)(n.code,{children:"Movable"})}),"\nand ",(0,i.jsx)(n.a,{href:"/docs/std/traits/copyable/Copyable/",children:(0,i.jsx)(n.code,{children:"Copyable"})})," built-in traits."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"/docs/std/collections/string/string/String/",children:(0,i.jsx)(n.code,{children:"String"})})," now has new\n",(0,i.jsx)(n.a,{href:"/docs/std/collections/string/string/String/#upper",children:(0,i.jsx)(n.code,{children:"toupper()"})})," and\n",(0,i.jsx)(n.a,{href:"/docs/std/collections/string/string/String/#lower",children:(0,i.jsx)(n.code,{children:"tolower()"})})," methods\nanalogous, respectively, to Python's ",(0,i.jsx)(n.code,{children:"str.toupper()"})," and ",(0,i.jsx)(n.code,{children:"str.tolower()"}),"."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Added a ",(0,i.jsx)(n.a,{href:"/docs/std/hashlib/hash/hash/",children:(0,i.jsx)(n.code,{children:"hash()"})})," built-in function and\n",(0,i.jsx)(n.a,{href:"/docs/std/hashlib/hash/Hashable/",children:(0,i.jsx)(n.code,{children:"Hashable"})})," trait for types\nimplementing the ",(0,i.jsx)(n.code,{children:"__hash__()"})," method. Future releases will add ",(0,i.jsx)(n.code,{children:"Hashable"}),"\nsupport to Standard Library types. In the meantime, the ",(0,i.jsx)(n.code,{children:"hash"})," module includes\na version of the ",(0,i.jsx)(n.code,{children:"hash()"})," function that works on arbitrary byte strings. To\ngenerate hashes for ",(0,i.jsx)(n.a,{href:"/docs/std/builtin/simd/SIMD/",children:(0,i.jsx)(n.code,{children:"SIMD"})})," types, you\nuse the internal ",(0,i.jsx)(n.code,{children:"_hash_simd()"})," function:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-mojo",children:"from builtin.hash import _hash_simd\n\nfn gen_simd_hash():\n let vector = SIMD[DType.int64, 4](1, 2, 3, 4)\n let hash = _hash_simd(vector)\n"})}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["Several standard library types now conform to the\n",(0,i.jsx)(n.code,{children:"CollectionElement"})," trait. These\ntypes include ",(0,i.jsx)(n.a,{href:"/docs/std/builtin/bool/Bool/",children:(0,i.jsx)(n.code,{children:"Bool"})}),",\n",(0,i.jsx)(n.a,{href:"/docs/std/builtin/string_literal/StringLiteral/",children:(0,i.jsx)(n.code,{children:"StringLiteral"})}),",\n",(0,i.jsx)(n.a,{href:"/docs/std/collections/list/List/",children:(0,i.jsx)(n.code,{children:"DynamicVector"})}),", ",(0,i.jsx)(n.code,{children:"Tensor"}),", ",(0,i.jsx)(n.code,{children:"TensorShape"}),",\nand ",(0,i.jsx)(n.code,{children:"TensorSpec"}),"."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"-changed",children:"\u{1F98B} Changed"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.code,{children:"utils.vector"})," has been moved to a new ",(0,i.jsx)(n.code,{children:"collections"})," package to make\nspace for new collections. This means that if you had previous code\nthat did ",(0,i.jsx)(n.code,{children:"from utils.vector import DynamicVector"}),", it now needs to\nbe ",(0,i.jsx)(n.code,{children:"from collections.vector import DynamicVector"})," due to the move."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:["The special destructor method ",(0,i.jsx)(n.code,{children:"__del__()"})," has been changed to enforce\nthat it cannot raise an error. Raising destructors are not supported properly\nat the moment."]}),"\n"]}),"\n"]}),"\n",(0,i.jsx)(n.h2,{id:"\uFE0F-fixed",children:"\u{1F6E0}\uFE0F Fixed"}),"\n",(0,i.jsxs)(n.ul,{children:["\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1421",children:"#1421"})," - Fixed a crash when\nusing Tuples in the REPL."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/222",children:"#222"})," - Generate an error\nfor obviously self recursive functions."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1408",children:"#1408"})," - Fix overload\nresolution when candidates can return generic types."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1413",children:"#1413"})," and\n",(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1395",children:"#1395"})," - Do not crash when\nre-declaring a builtin declaration."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1307",children:"#1307"})," - Fix compatibility of\nfunction signatures that only differ in default argument values."]}),"\n"]}),"\n",(0,i.jsxs)(n.li,{children:["\n",(0,i.jsxs)(n.p,{children:[(0,i.jsx)(n.a,{href:"https://github.com/modular/modular/issues/1380",children:"#1380"}
1)," - Fix printing\nof empty ",(0,i.jsx)(n.code,{children:"String"}),"."]}),"\n"]}),"\n"]})]})}function a(e={}){let{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(h,{...e})}):h(e)}},28453(e,n,s){s.d(n,{R:()=>o,x:()=>d});var r=s(96540);let i={},t=r.createContext(i);function o(e){let n=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:o(e.components),r.createElement(t.Provider,{value:n},e.children)}},180(e){e.exports=JSON.parse('{"permalink":"/releases/v0.6.1","source":"@site/releases/v0.6.1.md","title":"Mojo v0.6.1","description":"\u2B50\uFE0F New","date":"2023-12-18T00:00:00.000Z","tags":[],"hasTruncateMarker":false,"authors":[],"frontMatter":{"title":"Mojo v0.6.1","date":"2023-12-18T00:00:00.000Z","toc_max_heading_level":3,"noindex":true},"unlisted":false,"prevItem":{"title":"Mojo v0.7.0","permalink":"/releases/v0.7.0"},"nextItem":{"title":"Mojo v0.6.0","permalink":"/releases/v0.6.0"}}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.