Skip to content

Add more types of folded arguments. #7

Open

Description

@MarcCote

It would be really nice to handle different type of folded arguments. Here a list of what I think could be useful. Feel free to comment or suggest other types.

Listing

  • List: echo [1 3]
echo 1
echo 3
  • Range:
echo [1:4] echo [1:6:2]
echo 1 echo 1
echo 2 echo 3
echo 3 echo 5
  • Linspace: echo Lin[1:6:5]
echo 1
echo 2.25
echo 3.5
echo 4.75
echo 6
  • Logspace: echo Log[0:3:4]
echo 1
echo 10
echo 100
echo 1000

Random sampling

  • Uniform: echo U[0,1:3]
echo 0.999
echo 0.42
echo 0
  • Normal: echo N[0,1:4]
echo 1.5
echo -0.42
echo 0.0001
echo -0.9

Activity

  1. changed the title [-]Make the parser to handle range in argument[/-] [+]Add more types of folded arguments.[/+] on Dec 4, 2014
  2. mgermain commented on Jun 29, 2016

    @mgermain
    Member

    The remaining ones have been requested over and over. It's pretty simple to implement we just need to think of a nice way to put that in the command line.

  3. mgermain commented on Jun 29, 2016

    @mgermain
    Member

    Maybe we could unify all those like so:
    [1 3] -> List(1,3)
    [1:6:2] -> Range(1,6,2)
    Lin[1:6:5] -> Lin(1,6,5)
    N[0,1:4] -> N(0,1,4)

    Not sure though.
    What do you think @vdumoulin @rizar @caglar ?

  4. MarcCote commented on Jun 29, 2016

    @MarcCote
    MemberAuthor

    Maybe function names should all be lowercase?
    Also should we still support [1 3] and [1:6:2] for backward compatibility?

  5. fvisin commented on Jul 12, 2016

    @fvisin

    My suggestion is to try to stick to the typical Python syntax as much as possible:

    [1 3] -> [1, 3]
    [1:6:2] -> ok
    Lin[1:6:5] -> Lin(1,6,5)
    Log[1:6:5] -> Log(1,6,5)
    N[0,1:4] -> N(0,1,4)
    

    I don't have a strong preference on lowercase vs uppercase, but since N has to be uppercase maybe it makes sense to keep Log and Lin uppercase too.

  6. caglar commented on Aug 16, 2016

    @caglar

    For me suggestions made by both @mgermain and @fvisin are good. But I think I would prefer having lower case for Lin, Log and N functions.

  7. ieee8023 commented on May 3, 2017

    @ieee8023

    I vote for [] because bash cares about () sometimes.

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions