Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion beef-lang.org/content/corlib/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,6 @@ The following is a partial list of the funtionality provided by corlib. See the

## Multimedia libraries

The Beef IDE utilizes a windowing and multimedia library named Beefy2D. This library is only intended for use by the IDE and other internal Beef tools. This library is not documented or supported for this-party applications, and the API will change without regard for backwards compatibility. As such, other third-party libraries should be used by third-party applications.
The Beef IDE utilizes a windowing and multimedia library named Beefy2D. This library is only intended for use by the IDE and other internal Beef tools. This library is not documented or supported for third-party applications, and the API will change without regard for backwards compatibility. As such, other third-party libraries should be used by third-party applications.

One example of a third-party multimedia library is SDL2, whose use is illustrated in the included Beef samples.
3 changes: 1 addition & 2 deletions beef-lang.org/content/language-guide/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ void Use()
case .Err: Console.WriteLine("Failed");
}

/* This invokes an implicit conversion operator, which will be fatal at runtime if an error is returned */
int newVal = GetMinusOne(i);
uint newVal = GetMinusOne(i);

/* Result<T> contains a special "ReturnValueDiscarded" method which is invoked to facilitate failing fatally on ignored returned errors here */
GetMinusOne(i);
Expand Down
2 changes: 1 addition & 1 deletion beef-lang.org/content/language-guide/memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ Object c = new:allok box 4.5f; // Explicitly boxed through a custom allocator 'a
```

### Variants
The variant type `System.Variant` is an alternative to boxing. A variant is not an object type, and thus cannot perform dynamic interface dispatching, but a variant has the advantage that it can store small data types without allocation and it does not incur boxing code bloat. A variant can be converted into a heap-allocated boxed object via `Variant.GetBoxed`, but it will fail if the compiler hasn't generated an on-demand box type for the stored valuetype. Boxed type generation can be specifically requested via [reflection options](reflection.html).
The variant type `System.Variant` is an alternative to boxing. A variant is not an object type, and thus cannot perform dynamic interface dispatching, but a variant has the advantage that it can store small data types without allocation and it does not incur boxing code bloat. A variant can be converted into a heap-allocated boxed object via `Variant.GetBoxed`, but it will fail if the compiler hasn't generated an on-demand box type for the stored valuetype. Boxed type generation can be specifically requested via [reflection options]({{< ref "reflection.md" >}}).
2 changes: 1 addition & 1 deletion beef-lang.org/content/language-guide/operators.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ struct Vector2
/* Binary + operator */
public static Vector2 operator+(Vector2 lhs, Vector2 rhs)
{
return .(lhs.x, rhs.y);
return .(lhs.x + rhs.x, lhs.y + rhs.y);
}

/* Unary '-' operator */
Expand Down
2 changes: 1 addition & 1 deletion beef-lang.org/content/language-guide/typerefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ title = "Type References"

* Self - only valid within a definition of a class or struct, and refers to the defining type. If used within an interface, it refers to the implementing type.
* var/let - used with type inference when creating variables, `var` is used to create a mutable variable, whereas `let` creates a const or read-only variable
* . - The `.` type is used with type inference, and refers to "the expected type". The most common use is to change an implicit conversion into an explicit conversion without specifying the type name. (ie: intVal = (.)floatVal)
* . - The `.` type is used with type inference, and refers to "the expected type". The most common use is to change an implicit conversion into an explicit conversion without specifying the type name. (ie: int intVal = (.)floatVal;)