Skip to content

Commit

Permalink
deploy: 8344fa0
Browse files Browse the repository at this point in the history
  • Loading branch information
fubark committed Mar 24, 2024
1 parent 316a42e commit e6edb9a
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@
<body id="table-of-contents">
<header>
<h1 class="title">Cyber Docs</h1>
<div class="sub-title">v0.4-dev 158-1ef4515</div>
<div class="sub-title">v0.4-dev 158-8344fa0</div>
<ul>
<li><a href="https://cyberscript.dev" target="_blank" rel="noopener">Homepage</a></li>
<li><a href="https://cyberscript.dev/play.html" target="_blank" rel="noopener">Playground</a></li>
Expand Down Expand Up @@ -3835,16 +3835,16 @@ <h2 id="operator-overloading-1">Operator overloading. <a href="#operator-overloa
y float

func '$infix+'(o Vec2) Vec2:
return [Vec2
return Vec2{
x: x + o.x,
y: y + o.y,
]
}

func '$prefix-'() Vec2:
return [Vec2 x: -x, y: -y]
return Vec2{x: -x, y: -y}

var a = [Vec2 x: 1, y: 2]
var b = a + [Vec2 x: 3, y: 4]
var a = Vec2{x: 1, y: 2}
var b = a + Vec2{x: 3, y: 4}
var c = -a
</code></pre>
<p>Some special operators have their own name. This example overloads the <code>index</code> operator and the <code>set index</code> operator:</p>
Expand All @@ -3857,7 +3857,7 @@ <h2 id="operator-overloading-1">Operator overloading. <a href="#operator-overloa
func '$setIndex'(idx, val):
arr[idx * 2] = val

var a = [MyCollection arr: [1, 2, 3, 4]]
var a = MyCollection{arr: [1, 2, 3, 4]}
print a[1] -- Prints `3`
</code></pre>
<a href="#metaprogramming">^topic</a>
Expand All @@ -3877,7 +3877,7 @@ <h3 id="call-module">Call module. <a href="#call-module">#</a></h3>
y float

func Vec2.'$call'(x float, y float) Vec2:
return [Vec2 x: x, y: y]
return Vec2{x: x, y: y}

var v = Vec2(1, 2)
</code></pre>
Expand Down Expand Up @@ -3927,7 +3927,7 @@ <h3 id="missing-method">Missing method. <a href="#missing-method">#</a></h3>
func '$missing'(args...):
return args.len

var a = [A:]
var a = A{}
print a.foo() -- Output: '0'
print a.bar(1, 2) -- Output: '2'
</code></pre>
Expand Down

0 comments on commit e6edb9a

Please sign in to comment.