Not that I agree with the sentiment here, but just for discussion sake: Isn't this a (potentially) good candidate for code generation? Little complex, but...
> On Sep 30, 2016, at 10:05 PM, Wang Yarco <yarco.w...@gmail.com> wrote: > > > how would you end up dealing with your code being unable to compile for > > anyone else? > I think if i do have my own golang version app code, those are all used for > my own purpose (i don't think i'm a strong coding guy -- at the system level, > where who can make the code world wide used) > It must be something like customizing bash, adding some alias commands -- at > application level... > And if it is truly welcomed by everyone (like if `ll` for `ls -l`), then they > would add it to the default bash_profile i think... > > > Would you just not distribute this code? > No, it is open... > If it becomes closed, the reason must be there are about >1000 person begin > to laugh at my codes :) > > The only purpose is that i want to make it funny (writing golang code in my > way). > >> On Saturday, October 1, 2016 at 11:44:58 AM UTC+8, Justin Israel wrote: >> >> >>> On Sat, 1 Oct 2016, 4:25 PM Wang Yarco <yarco...@gmail.com> wrote: >>> Though there's no strict rule to name the instance when defining a method >>> of the struct: >>> type user struct { >>> name string >>> age int >>> } >>> >>> func(u *user) say() { >>> // ... >>> } >>> >>> Here we use `u`, but i still miss `this` feature, it does't mean i should >>> use `this`, below is my idea: >>> func (*user) say(){ // if want anonymous instance name?? >>> fmt.Println(ts.name, this.age); // the default `this` name can be both >>> `ts` and `this` or something i like to name >>> } >>> >>> func (u *user) whatever() { // then i also could define one >>> fmt.Println(u.name, u.age); // u overwrite using `ts` and `this` >>> } >>> >>> // both code should work >>> >>> I'm not going to say i wanna change the go lang syntax, but i do prefer to >>> add this to my golang version......so How? ( Or if it is complex, i leave >>> it to the future version of me) >> >> >> If you were able to apply this functionality to your own version of your Go >> compiler, how would you end up dealing with your code being unable to >> compile for anyone else? Would you just not distribute this code? >> >> >>> >>> -- >>> You received this message because you are subscribed to the Google Groups >>> "golang-nuts" group. >>> To unsubscribe from this group and stop receiving emails from it, send an >>> email to golang-nuts...@googlegroups.com. >>> For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.