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

cmp functions for string #238

Closed
huiyiqun opened this issue Oct 9, 2016 · 3 comments
Closed

cmp functions for string #238

huiyiqun opened this issue Oct 9, 2016 · 3 comments

Comments

@huiyiqun
Copy link
Contributor

huiyiqun commented Oct 9, 2016

Currently, we could compare string as float with some builtins such as >, < and ==.

However, how could we compare string as string?

@xiaq xiaq added this to the 1.0 milestone Oct 9, 2016
@xiaq
Copy link
Member

xiaq commented Oct 9, 2016

We will change == to work only on numbers and use eq for strings.

@xiaq
Copy link
Member

xiaq commented Oct 9, 2016

I planned to adopt the names Perl use for string comparisons, i.e. lt le eq ne gt ge. However, according to Debian, only eq has not been taken:


~$ le
The program 'le' is currently not installed.  To run 'le' please ask your administrator to install the package 'le'
le: command not found
~$ lt
The program 'lt' is currently not installed.  To run 'lt' please ask your administrator to install the package 'looptools'
lt: command not found
~$ eq
eq: command not found
~$ ne
The program 'ne' is currently not installed.  To run 'ne' please ask your administrator to install the package 'ne'
ne: command not found
~$ ge
The program 'ge' is currently not installed.  To run 'ge' please ask your administrator to install the package 'pvm-examples'
ge: command not found
~$ gt
The program 'gt' is currently not installed.  To run 'gt' please ask your administrator to install the package 'genometools'
gt: command not found

@xiaq
Copy link
Member

xiaq commented Oct 9, 2016

String comparison functions have been named <s <=s ==s !=s >s >=s, until we find a better way to name them.

@xiaq xiaq closed this as completed in f8c419a Oct 9, 2016
huiyiqun pushed a commit to huiyiqun/elvish that referenced this issue Oct 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants