U
U
uvelichitel2019-12-21 20:07:55
Rust
uvelichitel, 2019-12-21 20:07:55

In Rust, the arrow -> in the function declaration foo()->i32{ for beauty?

Is this arrow purely decorative or does it help the parser somehow? Is it possible to have a valid construction without a view arrow that would mean something other than a function declaration? It seems that Rust has a very concise syntax, is it possible that function was reduced to two letters, and the arrow was left for beauty, so that it looks like Haskell?))
fn foo(arg) type{

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2019-12-21
@Maksclub

Is it purely decorative or does it help the parser somehow?

Rather, the lexer will find the necessary tokens / lexemes
In this report, the PHP language, but don't be scared! Kirill Nesmeyanov very clearly and clearly showed how parsers and lexers of a certain abstract language are arranged in general:
https://youtu.be/zZTv7HMxKXI?t=16074

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question