-
Notifications
You must be signed in to change notification settings - Fork 9
ftd.space
and ftd.empty
rfc
#194
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
The addition of `ftd.space` and `ftd.empty` variables simplifies the process of | ||
adding space character and empty space. By providing these predefined variables | ||
for common formatting needs, makes `ftd` becomes more user-friendly when working | ||
with spacing and empty content. | ||
|
||
The `ftd.empty` can be used as default value of string type variable. This | ||
variable can later on append other strings on some events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should mention how our grammar does not allow people to create space or empty strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also need motivation for why we need space and empty string. What are the use cases?
`ftd` will now contains two predefined variables. These will be included in | ||
`default bag` in interpreter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not mention technical implementation in RFC. Remove the default bag bit.
|
||
-- ds.h3: `ftd.empty` | ||
|
||
The `ftd.empty` variable is defined to return an empty string. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change line to: The ftd.empty
variable contains empty string. Also change the ftd.space
. Variables do not return things. Functions return things.
ftd.space = function(arg) { | ||
let __arg__ = { | ||
a: 0, | ||
...arg | ||
}; | ||
if (__arg__.a <= 0) { | ||
return ''; | ||
} | ||
|
||
return ' '.repeat(__arg__.a); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is also tech/implementation detail. RFC should not include implementation details, only end user stuff.
As of now, there are no unresolved questions or issues related to the proposal | ||
of introducing `ftd.space` and `ftd.empty` variables to the ftd library. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One unresolved question is can we fix our grammar so that this is not needed. This is a limitation of our grammar after all.
@Arpita-Jaiswal I think there is case for I think we keep the |
No description provided.