Skip to content
New issue

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

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

Already on GitHub? # to your account

[Converters\as] Needs sanitization #1913

Open
drkameleon opened this issue Feb 27, 2025 · 0 comments
Open

[Converters\as] Needs sanitization #1913

drkameleon opened this issue Feb 27, 2025 · 0 comments
Labels
cleanup Code cleanup, comments and micro-optimizations → Converters enhancement New feature or request open discussion Open discussion about features/ideas/suggestions

Comments

@drkameleon
Copy link
Collaborator

Top priority

.binary, .hex, .octal ➞ ❌ remove

Instead of:

as.binary 10
as.hex 255
as.octal 8

We could simply have:

to :string .base:2 10          ; "1010"
to :string .base:16         ; "FF"
to :string .base:8 8           ; "10"

(with could use .binary, .hex, .octal too - although this would lead to unnecessary clutter for something that isn't even that common!)

Another idea would be using .format: which is already supported.


.code, .pretty, .unwrapped ➞ ✅ add new

Essentially, all three modes have to do representing an Arturo value as code - with .pretty and .unwrapped specifying what this code will look like.

So, we could create a new function (e.g. express, codify, or serialize - by order of personal preference lol) and keep .pretty & .unwrapped as options

Instead of:

as.code [a: 2]

We could simply have:

express [a: 2]

For future reference

.agnostic ➞ ✅ add new

Create a function with the same name (= agnostic)
With the prerequisite, that we are sure what this thing does.


.data ➞ ✅ add new

Create a function parse (that could be a generic shortcut for to :block ... and be used like a basis for creating our (and proper) parse equivalent.

.data could be an option, like now, to allow for "Arturo as data". (parse.data ...)
With the prerequisite, that we are sure what this thing does.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cleanup Code cleanup, comments and micro-optimizations → Converters enhancement New feature or request open discussion Open discussion about features/ideas/suggestions
Projects
Development

No branches or pull requests

1 participant