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

Rosetta Code tasks #164

Open
ahribellah opened this issue Dec 19, 2020 · 7 comments
Open

Rosetta Code tasks #164

ahribellah opened this issue Dec 19, 2020 · 7 comments
Assignees

Comments

@ahribellah
Copy link

In lieu of more extensive documentation, one thing we could do is work on Rosetta Code tasks. These give short, focused examples of how to do different things in the language.

Right now, there is exactly one: https://rosettacode.org/wiki/Category:Felix

There are currently 1081 tasks available: https://rosettacode.org/wiki/Category:Programming_Tasks

I'll probably start chipping away at these soon.

@ahribellah ahribellah self-assigned this Dec 19, 2020
@skaller
Copy link
Member

skaller commented Dec 20, 2020

Cool! Please add these to the repository. Let me add a directory for you.

skaller added a commit that referenced this issue Dec 20, 2020
@razetime
Copy link
Collaborator

would it be advisable to make a pull request for every rosetta code addition? Some rosetta code tasks are highly trivial and require more explanation than code.

@skaller
Copy link
Member

skaller commented Oct 25, 2022

Neither. I think I added you as a developer. Please check. You should be able to push directly to the repository

@razetime
Copy link
Collaborator

razetime commented Oct 26, 2022 via email

@skaller
Copy link
Member

skaller commented Oct 27, 2022

Sure!

@jlp765
Copy link
Contributor

jlp765 commented Jan 1, 2023

Some of the tasks will require reversing and sorting of strings and collections of data (varrays?).

Lists have a rev() function.

Is it planned to add this in the standard library for strings and other data types like varray?

Or is it expected that the user will roll their own, something like:

fun rev[T] (x:varray[T]): varray[T] = {
  var sz = len(x);
  var o = varray[T]$ sz;

  for var i in 0uz upto (sz - 1) do
    push_back (o, x.(sz - 1 - i));
  done
  return o;
}

@skaller
Copy link
Member

skaller commented Jan 1, 2023

Note that, since Felix strings are C++ strings ... you can always write code in C++ and then embed it in Felix code.
If you find you need a routine that should be in the standard library, but isn't, we can always add it in there.

Notice, the varray sort in the standard library is actually C++ standard library sort.

I'm not sure if sorting or reversing a string belongs in the standard library or not, but it really
cannot hurt.

I add things to the library when I need them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants