Comments (3)
The slashes and whatnot are my shitty ascii version of the arrows in the whiteboard photo above :)
Correct: "send processes, receive names"
Incorrect: "send on processes, receive on names"
You always send and receive on names. But the thing which you send must be a process, and the thing you receive on the other end is the quote of the sent process, which is a name.
Or is that not right "Foo" is a process and @ makes it a name you can send on?
Correct
And then, when you receive on @"Foo" you get something that is a name?
Correct; You always receive names.
(but then you can put "for (@x <- @"Foo")" to make it a process? Totally confusing.
The thing you received is still a name. You always receive names. The difference is that you used pattern matching so that the name you received matches @x
thus x
itself is a process. Here's the relevant part of the tutorial https://github.com/JoshOrndorff/LearnRholangByExample/tree/master/10-MoreSyntax#receiving-processes
Also there is a thing called a name-variable, and a process-variable.
Correct
So, one could have just an 'x' but it is a process variable (no @ sign in front) but also a name 'x' that is a name-variable. This further confuses
Variable names don't reflect their types. Just like in java int x = 4;
is perfectly valid and double x = 3.2;
is perfectly valid. What you call the variable doesn't indicate anything about its type.
You should come to my office hours Thursday mornings at 7:00am your time. I'll be expecting you :)
from learnrholangbyexample.
The poor dude whose github handle is @x probably gets tagged in a bunch of rholang related posts.
Maybe I should start writing all of my example receives as for (@glenbraun <- badassProgrammers){...}
BTW, that would make glenbraun a process variable.
from learnrholangbyexample.
But, then one can do:
new foo in { … }, which seems to create a name called "foo".
When one does: for (foo <- bar) { }
both foo and bar are names? but: for (@foo <- bar) makes foo a process? Is foo a name variable in the first and a process variable in the second? or the other way around? Are the three letters 'f' then 'o', then 'o' a name variable, but the syntax '@' makes it a process variable? or the other way around. I guess I'm being thick but it makes no sense to me. I get it a little that what can be put into the RSpace are processes that are quoted, rather than names. The name is the key, the quoted process is the value. Best, I know. It will likely make sense for me someday, but I have to think there must be some other programmer out there who will try to learn Rholang who has a similar issue. It seems the description needs some better way to describe it. I think the usage seems to depend on context, whether one is receiving or sending (maybe, I don't know). Anyway, will keep at it and see if it becomes more clear over time.
from learnrholangbyexample.
Related Issues (16)
- 0 vs. Nil for smallest / stopped process HOT 1
- Make the cheat sheet look pro
- Discuss pattern matching on basic types
- Possible error with bundle examples in Rholang Cheat Sheet HOT 1
- Peek example of double checking has race condition HOT 1
- Use of new print(`rho:io:stdout`) is a poor suggested usage HOT 2
- Bound and free names confusing HOT 1
- Visual corrections HOT 5
- Ch 1 Exercises confusion HOT 2
- Ch 0 mirror link 404 HOT 1
- Proper solution to the patience game
- bytearray methods
- Make tutorial a nice looking web page HOT 2
- Adding a zip file with all of the .rho exercises HOT 1
- Discuss string interpolation HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from learnrholangbyexample.