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

Deprecate repeat(x) #74

Closed
briancavalier opened this issue Feb 3, 2015 · 4 comments · Fixed by #76
Closed

Deprecate repeat(x) #74

briancavalier opened this issue Feb 3, 2015 · 4 comments · Fixed by #76
Milestone

Comments

@briancavalier
Copy link
Member

It seems at best useless, and at worst dangerous :)

It's basically a continuous constant signal, but implemented as discrete events, which is problematic: infinitely many occurrences of x at infinitely small time intervals O.o ... it will happily blast out xs as fast as it possibly can.

Some better options might be:

  1. Change repeat to take a time interval: repeat(period, value)
  2. Change periodic to take a value (or an optional value, :/ )
  3. Invent a new operation that takes a time interval and value
@unscriptable
Copy link
Member

\4. rename repeat to blast 😄

Atm, I'm thinking that (2) is the right thing (without optional param). I may be totally off base, but I would imagine that the current event produced by period (arrival time in msec) is thrown out in most use cases.

Hrrrmmm... if somebody wants something similar, can they use most.timestamp()?

@briancavalier
Copy link
Member Author

Atm, I'm thinking that (2) is the right thing (without optional param)

Hmm, yeah, actually option 2 isn't so bad. The parameter could be "required", which means you just get undefined if you leave it off.

I would imagine that the current event produced by period (arrival time in msec) is thrown out in most use cases

Yeah, I don't see the current time being all that useful either.

can they use most.timestamp()?

They can. It'd be slightly different in that they get a { value, time } object, but still, you're right: the point is that they can get the time if needed.

@briancavalier
Copy link
Member Author

rename repeat to blast

Haha. Or how about incessantly(x)?

I do like periodic(period, value) very much. I've been thinking that there should also be a simple way to create a stream of a single, delayed value. That could be delayed(delay, value) which is a nice parallel to periodic(period, value).

@briancavalier
Copy link
Member Author

For discussion/reference I modified periodic to take a value in the add-periodic-value branch. See 532fa80

briancavalier added a commit that referenced this issue Feb 9, 2015
Deprecate most.repeat. Close #74
briancavalier added a commit that referenced this issue Feb 10, 2015
Deprecate most.repeat. Close #74
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

Successfully merging a pull request may close this issue.

2 participants