Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tables doc #3239

Merged
merged 9 commits into from
Oct 3, 2023
Merged

tables doc #3239

merged 9 commits into from
Oct 3, 2023

Conversation

a-m-lamb
Copy link
Contributor

@a-m-lamb a-m-lamb commented Sep 12, 2023

Description

Type of Change

  • Adding a new entry
  • Updating the documentation

Checklist

  • All writings are my own.
  • My entry follows the Codecademy Docs style guide.
  • My changes generate no new warnings.
  • I have performed a self-review of my own writing and code.
  • I have checked my entry and corrected any misspellings.
  • I have made corresponding changes to the documentation if needed.
  • I have confirmed my changes are not being pushed from my forked main branch.
  • I have confirmed that I'm pushing from a new branch named after the changes I'm making.
  • Under "Development" on the right, I have linked any issues that are relevant to this PR (write "Closes # in the "Description" above).
@CLAassistant
Copy link

CLAassistant commented Sep 12, 2023

CLA assistant check
All committers have signed the CLA.

@@ -0,0 +1,76 @@
---
Title: 'Tables'
Description: 'luau is a scripting language particularly for Roblox game development. This document is meant to demonstrate the use case for luau tables.'
Copy link
Contributor

@CBID2 CBID2 Sep 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[proofreading] Consider briefly defining tables as opposed to luau. It'll help make the entry more cohesive.

Suggested change
Description: 'luau is a scripting language particularly for Roblox game development. This document is meant to demonstrate the use case for luau tables.'
Description: 'In the context of luau and Roblox, tables are data types that can store any types of value.'
local table = {}
```

In the context of Lua, the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you wanted to instantiate a table with parameters you can write something like this:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[proofreading] Since tables are being discussed in a Luau context, consider using that instead of Lua. Also, hyperlink the word to help readers see the connection more.

Suggested change
In the context of Lua, the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you wanted to instantiate a table with parameters you can write something like this:
In the context of [Luau](https://www.codecademy.com/resources/docs/luau), the local keyword is primarily used to declare local variables. It is not used specifically for instantiating tables. You can use the local keyword to create local variables of various types, including tables, numbers, strings, functions, and more. What creates the table is the curly braces in the syntax ({}). If you want to instantiate a table with parameters you can write something like this:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah, good point

Copy link
Contributor

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @a-m-lamb! :) Your PR is off to a great start! :) I just gave some tips on how you can improve it.

@a-m-lamb a-m-lamb requested a review from CBID2 September 13, 2023 12:04
Copy link
Contributor

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made another suggestion.

### Accessing Items


If your table is set up like an array, an important thing to note is that the index begins at 1 rather than at 0 as it is for other languages. Let's use this table as an example:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright. I'm not seeing a path for dictionary documentation. Does that not exist yet? lol Should I just create a hyperlink for each datatype?

@SSwiniarski SSwiniarski linked an issue Sep 13, 2023 that may be closed by this pull request
3 tasks
@SSwiniarski SSwiniarski added new entry New entry or entries luau Luau entries labels Sep 13, 2023
@a-m-lamb a-m-lamb requested a review from CBID2 September 14, 2023 15:59
Copy link
Contributor

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @a-m-lamb! :) Now you just a review from @SSwiniarski and then another review from a different maintainer.

Copy link
Contributor

@CBID2 CBID2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done

@caupolicandiaz caupolicandiaz self-assigned this Sep 19, 2023
@caupolicandiaz caupolicandiaz added the status: under review Issue or PR is currently being reviewed label Sep 19, 2023
Copy link
Collaborator

@caupolicandiaz caupolicandiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-m-lamb I've completed my initial review. Please update the entry, and tag me when you've finished making changes. Thanks

content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Show resolved Hide resolved
content/luau/concepts/tables/tables.md Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
content/luau/concepts/tables/tables.md Outdated Show resolved Hide resolved
Calling items from a table when it's formatted like a dictionary is a little different. You can get the value of items by the keys. Below is an example of how you can get the username value from the profile table.

```
//creating the profile table
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code blocks should use 2 spaces for indentations, not tabs. Comments should have a space and begin with a capital -
// Printing the username in the table

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I do agree

yangc95 and others added 2 commits September 25, 2023 16:26
Co-authored-by: caupolicandiaz <caupolicandiaz@gmail.com>
Copy link
Collaborator

@caupolicandiaz caupolicandiaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-m-lamb For the sake of moving this entry along I went ahead and made the changes directly. This is ready for a second review.

Copy link
Collaborator

@SSwiniarski SSwiniarski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@a-m-lamb, @caupolicandiaz I made one small change and it looks good to go.

@SSwiniarski SSwiniarski merged commit 4bd93db into Codecademy:main Oct 3, 2023
6 checks passed
@github-actions
Copy link

github-actions bot commented Oct 3, 2023

👋 @a-m-lamb
You have contributed to Codecademy Docs, and we would like to know more about you and your experience.
Please take a minute to fill out this four question survey to help us better understand Docs contributions and how we can improve the experience for you and our learners.
Thank you for your help!

🎉 Your contribution(s) can be seen here:

https://www.codecademy.com/resources/docs/luau/tables

Please note it may take a little while for changes to become visible.
If you're appearing as anonymous and want to be credited, see here.

Copy link

@Letsgoque Letsgoque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do agree

Calling items from a table when it's formatted like a dictionary is a little different. You can get the value of items by the keys. Below is an example of how you can get the username value from the profile table.

```
//creating the profile table

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I do agree

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment