Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
GITBOOK-39: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
Ze7111 authored and gitbook-bot committed May 13, 2023
1 parent e918513 commit 12b54fa
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
4 changes: 2 additions & 2 deletions getting-started/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

* <mark style="color:blue;">**Windows 10 (x64)**</mark> or above
* <mark style="color:green;">**Code editor**</mark>, I recommend [**Visual Studio Code**](https://code.visualstudio.com/download), along with the [**Versace Extension**](https://marketplace.visualstudio.com/items?itemName=ZE7111.Versace). &#x20;
* <mark style="color:yellow;">Python 3.6.0</mark> **** or above **** (optional) if you do not have it you can download it [**here!**](https://www.python.org/downloads/release/python-3110/)****
* <mark style="color:yellow;">Python 3.6.0</mark> or above (optional) if you do not have it you can download it [**here!**](https://www.python.org/downloads/release/python-3110/)

## Installation ✅

Expand All @@ -27,7 +27,7 @@ This method is **not** entirely reliable, due to the you having to do all the st
{% endhint %}

{% hint style="warning" %}
For installing for **Mac** or **Linux** click [**here.**](https://github.com/Ze7111/Versace/releases/latest)****
For installing for **Mac** or **Linux** click [**here.**](https://github.com/Ze7111/Versace/releases/latest)
{% endhint %}

1. Download the `(yourOS)-Versace-(version).zip` from the respective post.
Expand Down
2 changes: 1 addition & 1 deletion getting-started/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ In most aspects Versace is better than other readily available languages, for st

Versace also has the ability to transpile code written in Versace to python, or even a binary executable.&#x20;

Versace has excellent runtime speeds (Versace runtime <mark style="color:green;">**0.043s**</mark>, C++ runtime ** **<mark style="color:yellow;">**0.032s**</mark>, Python runtime <mark style="color:red;">**0.076s**</mark>) \* even the compiled versions of your code will run much faster than python, but still a little slower than C++.&#x20;
Versace has excellent runtime speeds (Versace runtime <mark style="color:green;">**0.043s**</mark>, C++ runtime <mark style="color:yellow;">**0.032s**</mark>, Python runtime <mark style="color:red;">**0.076s**</mark>) \* even the compiled versions of your code will run much faster than python, but still a little slower than C++.&#x20;

Best part? - IT DOES NOT NEED ANY COMPILER TO WORK, all it needs is python, and if python is not there don't worry, it will still execute Versace code, you will only lose the ability to compile it to a binary executable.

Expand Down
20 changes: 20 additions & 0 deletions versace-detailed-docs/functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,12 @@ Functions are prevalent in Versace code. You’ve already seen one of the most i

Versace code uses snake case as the conventional style for function and variable names, in which all letters are lowercase and underscores separate words. Here’s a program that contains an example function definition:

<div align="left">

<figure><img src="../.gitbook/assets/image (1).png" alt="public main() { out << &#x22;Hello World&#x22;; call some_function(); } func some_function() { out << &#x22;This is some_function&#x22;; }"><figcaption></figcaption></figure>

</div>

When you call a function, the program jumps to the function’s definition and executes the statements there. When the function ends, the program returns to the point where the function was called. This is called a function call.

We can call any function we’ve defined by entering its name followed by a set of parentheses. Because some\_function is defined in the program, it can be called from inside the main function. Note that we defined another\_function after the main function in the source code; we could have defined it before as well. Versace doesn’t care where you define your functions, only that they’re defined somewhere in a scope that can be seen by the caller.
Expand All @@ -22,8 +26,12 @@ This does not apply for any calls made outside of the main function. If you call

Functions can also take parameters. Parameters are variables that are passed to the function when it is called. The function can then use the parameters as if they were regular variables. Here’s an example of a function that takes two parameters:

<div align="left">

<figure><img src="../.gitbook/assets/image (7).png" alt="public main() { out << &#x22;Hello World&#x22;; call print_sum(5, 10); } func print_sum(int a, int b) { out << a + b; }"><figcaption></figcaption></figure>

</div>

In this example, the function print\_sum takes two parameters, a and b. When the function is called, the values 5 and 10 are passed to the parameters a and b, respectively. The function then prints the sum of a and b.

```
Expand All @@ -37,8 +45,12 @@ This is the output of the program. The function print\_sum is called with the ar

Functions can also return values. When a function returns a value, the caller can store the value in a variable or use it in some other way. Here’s an example of a function that returns a value:

<div align="left">

<figure><img src="../.gitbook/assets/image (2).png" alt="public main() { int product; out << &#x22;Hello World&#x22;; let product = get_product(5, 10); out << product; } func get_product(int a, int b) { return a * b; }"><figcaption></figcaption></figure>

</div>

In this example, the function get\_product takes two parameters, a and b. When the function is called, the values 5 and 10 are passed to the parameters a and b, respectively. The function then returns the product of a and b.

```
Expand All @@ -60,8 +72,12 @@ This is the output of the program. The function get\_product is called with the

1. What is the output of the following program?

<div align="left">

<figure><img src="../.gitbook/assets/image (5).png" alt="public main() { out << &#x22;Hello World&#x22;; call print_sum(15, 10); } func print_sum(a, b) { out << a + b; }"><figcaption></figcaption></figure>

</div>

* a. 15&#x20;
* b. 25&#x20;
* c. 10&#x20;
Expand All @@ -77,8 +93,12 @@ Answer is B because the function print\_sum is called with the arguments 15 and

2. What is the output of the following program?

<div align="left">

<figure><img src="../.gitbook/assets/image.png" alt="public main() { int product; out << &#x22;Hello World&#x22;; let product = get_product(5, 10); out << product; }"><figcaption></figcaption></figure>

</div>

* a. 50&#x20;
* b. 15&#x20;
* c. 5&#x20;
Expand Down
2 changes: 2 additions & 0 deletions versace/low-level-access.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,12 @@ alloc(10); // Allocates 10 MB of memory

You can deallocate memory by using the `dealloc` keyword like follows:

{% code fullWidth="false" %}
```cs
dealloc(5); // Deallocates 5 MB out of the 10 MB allocated
dealloc(); // Deallocates all allocated memory
```
{% endcode %}

{% hint style="danger" %}
You can <mark style="color:red;">**NOT**</mark> allocate more memory then is available on the computer. If you try to allocate more memory then is available, it will throw an error. This also happens Vice Versa, if you try to deallocate more memory then is allocated, it will throw an error.
Expand Down

0 comments on commit 12b54fa

Please sign in to comment.