Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Purpose

The purpose of this page is to capture proposals of syntactic sugaring to benefit users of Rholang and to track discussion and decision-making related to these proposals.

...

ProposalDiscussionDecision

let

PLet. Proc2 ::= "let" [Binding] "in" "{" Proc3 "}";

BindingProcToPat. Binding ::= [Name] NameRemainder "<-" Proc3 ;

prototyped in PR #2055

see also RCHAIN-2641

The delimiter shown is ←; should it be =?


lambda

@ListOps!("foreach", 
          [1,2,3],
          (x, ret) => {ret!(x+1)},
          *retCh)

...would be desugared to:

new lambda1 in {
contract lambda1(x, ret) = { ret! (x+1)} |
@ListOps!("foreach",
          [1,2,3],
          lambda1,
          *retCh)
}

The desugared version is what one has to write anyway in order to use tools like ListOps.

The expressiveness of Rholang will be hugely improved.


"method channels" (technically they are not methods but I have no idea how to call them (big grin))

contract channel.methodName(a, b, c) | channel.methodName!(P, Q, R)

will translate to:

contract channel(@"methodName", a, b, c) | channel!("methodName", P, Q, R)


Could make the code more readable and also friendlier to OOP devs