import dict #45

Merged
defunkt merged 5 commits from import into main 2025-11-10 04:07:33 +00:00
Owner

This imports all of the keys of a dict into the local scope:

something | to-uppercase | echo    #=> SOMETHING

Can take multiple dicts: import math str

Can also specify one or more keys to import specifically:

import str only=[to-upper to-lower]
import math only=random

Also adds -I to cli to allow importing on the command line, combined with print or -E to print the result of the evaluated code:

$ shrimp -I str -E 'something | to-upper'
SOMETHING

$ shrimp -Imath -E '(random) * 100 | floor'
36
This imports all of the keys of a dict into the local scope: ```import str something | to-uppercase | echo #=> SOMETHING ``` Can take multiple dicts: `import math str` Can also specify one or more keys to import specifically: ``` import str only=[to-upper to-lower] import math only=random ``` Also adds `-I` to cli to allow importing on the command line, combined with `print` or `-E` to print the result of the evaluated code: ``` $ shrimp -I str -E 'something | to-upper' SOMETHING $ shrimp -Imath -E '(random) * 100 | floor' 36 ```
defunkt added 5 commits 2025-11-10 03:55:48 +00:00
defunkt force-pushed import from 3a1e9e9250 to 10e1986fe2 2025-11-10 04:07:27 +00:00 Compare
defunkt merged commit feae5d314e into main 2025-11-10 04:07:33 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: probablycorey/shrimp#45
No description provided.