freddylist / llama Goto Github PK
View Code? Open in Web Editor NEWLuau Library for Immutable Data
Home Page: https://freddylist.github.io/llama/
License: MIT License
Luau Library for Immutable Data
Home Page: https://freddylist.github.io/llama/
License: MIT License
Despite failing tests, the status is returning true.
https://github.com/freddylist/llama/runs/5753236985?check_suite_focus=true
Failures are a result of luau-specific apis when the test runner runs stock Lua 5.1.
We should add Luau typings so that folks using Llama in Studio (and future external code editor users) can get type analysis.
Probably PEBCAK but I copied the src and renamed it to Llama. Upon start I got :
18:16:42.032 [18:16:42] [Store] [INFO] Global store is ready - Server - Logger:15
18:16:42.033 t is not a valid member of ModuleScript "ReplicatedStorage.Libraries.Llama" - Server - copy:4
18:16:42.033 Stack Begin - Studio
18:16:42.034 Script 'ReplicatedStorage.Libraries.Llama.Dictionary.copy', Line 4 - Studio - copy:4
18:16:42.034 Stack End - Studio
18:16:42.034 Requested module experienced an error while loading - Server - Dictionary:2
18:16:42.035 Stack Begin - Studio
18:16:42.035 Script 'ReplicatedStorage.Libraries.Llama.Dictionary', Line 2 - Studio - Dictionary:2
18:16:42.035 Stack End - Studio
18:16:42.035 Requested module experienced an error while loading - Server - Llama:2
18:16:42.035 Stack Begin - Studio
18:16:42.036 Script 'ReplicatedStorage.Libraries.Llama', Line 2 - Studio - Llama:2
18:16:42.036 Stack End - Studio
18:16:42.036 Requested module experienced an error while loading - Server - PlayerManager:16
18:16:42.036 Stack Begin - Studio
18:16:42.037 Script 'ServerStorage.ModuleScripts.PlayerManager', Line 16 - Studio - PlayerManager:16
18:16:42.037 Stack End - Studio
I found the type t under modules but should I copy that as well?
Hey ๐
It would be cool if the library was able to find t
at other places than within the library root itself. That way, I can re-use the same t
library for Llama and the rest of my project.
If you want I can submit a PR for that, I would do something similar to what I did for my roact animation library flick
: https://gitlab.com/seaofvoices/flick/-/blob/master/src/FindRoact.lua
I would just wrap each thing that require t
to require a module script that searches for t
and then forward it. Let me know if that is something you want ๐
All links to documentation link to https://frelerik.github.io/llama/ but documentation is now at https://freddylist.github.io/llama/ .
Additionally, I noticed the link in the docs to the repo links to https://github.com/Frelerik/llama/ . Luckily, this still works due to Github's automatic redirect, but it should be changed to https://github.com/freddylist/llama .
The docs say Download the .rbxmx model file from the latest release on the Llama releases page.
, but that page is empty at the moment.
Llama.List.insert({}, 1, "test")
-> {}
Llama.List.insert({ "test" }, 2, "test2" )
-> { "test" }
Will send in a PR tomorrow, hopefully.
Luau recently added table.freeze
, which makes tables read-only. It'd be good to enforce this throughout LLama - all methods should return frozen tables.
Probably something I am doing wrong here but see the last two cases
local l = List.create(5,"foo")
print(l)
-- Result OK
[1] = "foo",
[2] = "foo",
[3] = "foo",
[4] = "foo",
[5] = "foo"
print(List.set(l, 1, "foz"))
-- OK
[1] = "foz",
[2] = "foo",
[3] = "foo",
[4] = "foo",
[5] = "foo"
print(List.set(l, -1, "bar"))
-- OK
[1] = "foo",
[2] = "foo",
[3] = "foo",
[4] = "bar",
[5] = "foo"
-- Should error? Or add value at index 6?
print(List.set(l, 6, "baz"))
[1] = "foo",
[2] = "foo",
[3] = "foo",
[4] = "foo",
[5] = "foo"
-- Should set last value to "baz", but errors
print(List.set(l, 0, "baz"))
--[[
12:24:03.853 ReplicatedStorage.Common.Llama.List.set:17: index 0 out of bounds of list of length 5 - Server - set:17
12:24:03.854 Stack Begin - Studio
12:24:03.854 Script 'ReplicatedStorage.Common.Llama.List.set', Line 17 - function set - Studio - set:17
12:24:03.854 Script 'ServerScriptService.Server', Line 49 - Studio - Server:49
12:24:03.854 Stack End - Studio
]]
Full code
local l = List.create(5,"foo")
print(l)
print(List.set(l, 1, "foz"))
print(List.set(l, -1, "bar"))
print(List.set(l, 6, "baz"))
print(List.set(l, 0, "baz"))
MkDocs was super easy to set up, but I think we should join the cool kids and use Docusaurus.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.