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

explicitly close implicit calls #205

Open
aeosynth opened this issue Mar 7, 2013 · 21 comments
Open

explicitly close implicit calls #205

aeosynth opened this issue Mar 7, 2013 · 21 comments

Comments

@aeosynth
Copy link

aeosynth commented Mar 7, 2013

eg f a ^^ b -> f(a)(b). i'm not method chaining

currently, i have to write f(a) b, (f a) b

@vendethiel
Copy link
Contributor

we may use <| to reflect wirh |>

@satyr
Copy link
Owner

satyr commented Mar 7, 2013

Current paren-free (but ugly) solutions are:

  • f a .call null b
  • f a |>& b

use <|

How'd that help?

@vendethiel
Copy link
Contributor

a b <| c => a(b) c

@satyr
Copy link
Owner

satyr commented Mar 7, 2013

That's hardly a reverse of |>; doesn't make sense.

@vendethiel
Copy link
Contributor

indeed, we can't use $ etc

@satyr
Copy link
Owner

satyr commented Mar 7, 2013

F♯ you mean?

Another solution:

Function::$ = -> @apply null, arguments

f a .$ b

which imitates Haskell's $.

@michaelficarra
Copy link
Contributor

Huh, that's neat.

@vendethiel
Copy link
Contributor

F♯ you mean?

thanks - had trouble remembering where it was from

which imitates Haskell's $.

indeed, but -- that's horrendously slow :/.

@satyr
Copy link
Owner

satyr commented Mar 8, 2013

And another:

Function::<<<_:~->@

f a ._ b

Workarounds aside, I guess we can add it if we can find an intuitive symbol for it. The proposed ^^ doesn't feel quite right.

@vendethiel
Copy link
Contributor

EDIT : removed the part where I'm dumb.

any suggest ?

@qqueue
Copy link

qqueue commented Mar 8, 2013

f a >< b

sort of looks like the middle parentheses of

( f a )( b )

if you squint.

@aeosynth
Copy link
Author

aeosynth commented Mar 8, 2013

f a |>& b doesn't help if i want to store the final result:

$ coco -bce 'c = f a |>& b'
var x0$, c;
x0$ = c = f(a);
x0$(b);

not sure if this is a bug

@vendethiel
Copy link
Contributor

no, that's how refs work

@michaelficarra
Copy link
Contributor

Why aren't we just stealing LiveScript's <|?

a b <| c

@vendethiel
Copy link
Contributor

That's hardly a reverse of |>; doesn't make sense.

@michaelficarra
Copy link
Contributor

Sure, but does it have to be?

@vendethiel
Copy link
Contributor

does it have to be what?

@michaelficarra
Copy link
Contributor

Functionally related to |>.

@aeosynth
Copy link
Author

aeosynth commented Mar 8, 2013

variations: >|, |<

@vendethiel
Copy link
Contributor

Functionally related to |>.

No I agree and I'd +1 the <| but yeah |> is ref in coco

@satyr
Copy link
Owner

satyr commented Mar 9, 2013

f a >< b sort of looks like the middle parentheses of ( f a )( b )

Nice one. Easily extendable to an existential version: f a >?< b

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

5 participants