The Wayback Machine - https://web.archive.org/web/20200528054941/https://github.com/vlang/v/issues/4163
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

Documentation Run/Copy issues and Play Example issue #4163

Open
Indribell opened this issue Mar 30, 2020 · 1 comment
Open

Documentation Run/Copy issues and Play Example issue #4163

Indribell opened this issue Mar 30, 2020 · 1 comment
Assignees
Projects
Milestone

Comments

@Indribell
Copy link

@Indribell Indribell commented Mar 30, 2020

1. https://vlang.io/play

Example ( JSON decoding/encoding ):

Returns:
You just found a bug. V can't compile this program, but it should. Please create a GitHub issue.

Solution: ?

2. https://vlang.io/docs

fn main() { age = 21 }

Using Run works perfectly.

But all other examples like Strings, ...

name := 'Bob' println('Hello, $name!') // $is used for string interpolation println(name.len) bobby := name + 'by' // + is used to concatenate strings println(bobby) // "Bobby" println(bobby[1..3]) // "ob" mut s := 'hello ' s += 'world' //+=is used to append to a string println(s) // "hello world"
Will fail because of the lacking "fn main() {}" is not automatically applied.

Solution: Remove the few "fn main() {" from the first documentation examples and automatically add "fn main(){ // CODE// }" to the Javascript that copies the code to the Play section.

@nedpals
Copy link
Contributor

@nedpals nedpals commented Mar 31, 2020

Oops, nevermind. There is a dedicated issue tag for playground. Apologies.

@M4SSD35TRUCT10N M4SSD35TRUCT10N added this to Issues, bugs, features and similar in V 0.2 Apr 5, 2020
@M4SSD35TRUCT10N M4SSD35TRUCT10N added this to the Beta Release milestone Apr 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
4 participants
You can’t perform that action at this time.