go-mruby icon indicating copy to clipboard operation
go-mruby copied to clipboard

Can't tell from the docs but is there an Encode which is the pair of Decode

Open gaffo opened this issue 8 years ago • 7 comments

If not it'd be nice to have this as well.

gaffo avatar Feb 12 '17 19:02 gaffo

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney [email protected] wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread https://github.com/notifications/unsubscribe-auth/AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk .

erikh avatar Feb 12 '17 20:02 erikh

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney [email protected] wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279247929, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAvLK-iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk .

gaffo avatar Feb 12 '17 20:02 gaffo

Sorry to be blunt; that seems really fragile. What's the use-case?

On Sun, Feb 12, 2017 at 12:57 PM, Mike Gaffney [email protected] wrote:

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney <[email protected]

wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279247929 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLK- iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279248217, or mute the thread https://github.com/notifications/unsubscribe-auth/AABJ64wxoSAgwJwnxQDZdw7a508mx9Yrks5rb3I2gaJpZM4L-lwk .

erikh avatar Feb 12 '17 20:02 erikh

Piping data into application logic from go, processing it and pulling it back out.

On Feb 12, 2017 12:58, "Erik Hollensbe" [email protected] wrote:

Sorry to be blunt; that seems really fragile. What's the use-case?

On Sun, Feb 12, 2017 at 12:57 PM, Mike Gaffney [email protected] wrote:

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney < [email protected]

wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279247929 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLK- iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279248217 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64wxoSAgwJwnxQDZdw7a508mx9Yrks5rb3I2gaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279248271, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAvLNGpgMGxi1yyqIPup2tAvNdfBsr2ks5rb3JngaJpZM4L-lwk .

gaffo avatar Feb 12 '17 21:02 gaffo

Please look at the Value.String methods. they call inspect for the ugly cases, which is probably what Encode would do too.

I don't know if I have a say in this, but otherwise, I don't think this is really worthwhile to add. It's going to be fragile at best and hard to maintain regardless due to all the string mess it'll generate.

@mitchellh?

On Sun, Feb 12, 2017 at 1:09 PM, Mike Gaffney [email protected] wrote:

Piping data into application logic from go, processing it and pulling it back out.

On Feb 12, 2017 12:58, "Erik Hollensbe" [email protected] wrote:

Sorry to be blunt; that seems really fragile. What's the use-case?

On Sun, Feb 12, 2017 at 12:57 PM, Mike Gaffney <[email protected]

wrote:

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney < [email protected]

wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279247929 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLK- iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279248217 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64wxoSAgwJwnxQDZdw7a508mx9Yrks5rb3I2gaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279248271 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AAAvLNGpgMGxi1yyqIPup2tAvNdfBsr2ks5rb3JngaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279249203, or mute the thread https://github.com/notifications/unsubscribe-auth/AABJ6wBWPVAzkiw88zkOF-leYCbBkx3Iks5rb3UWgaJpZM4L-lwk .

erikh avatar Feb 12 '17 22:02 erikh

If you feel it's necessary enough for your application, would you be willing to submit a patch that we could discuss?

On Sun, Feb 12, 2017 at 2:30 PM, Erik Hollensbe [email protected] wrote:

Please look at the Value.String methods. they call inspect for the ugly cases, which is probably what Encode would do too.

I don't know if I have a say in this, but otherwise, I don't think this is really worthwhile to add. It's going to be fragile at best and hard to maintain regardless due to all the string mess it'll generate.

@mitchellh?

On Sun, Feb 12, 2017 at 1:09 PM, Mike Gaffney [email protected] wrote:

Piping data into application logic from go, processing it and pulling it back out.

On Feb 12, 2017 12:58, "Erik Hollensbe" [email protected] wrote:

Sorry to be blunt; that seems really fragile. What's the use-case?

On Sun, Feb 12, 2017 at 12:57 PM, Mike Gaffney < [email protected]> wrote:

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney < [email protected]

wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279247929 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLK- iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecommen t-279248217 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64wxoSAgwJwnxQDZdw7a508mx9Yrks5rb3I2gaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279248271 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLNGpg MGxi1yyqIPup2tAvNdfBsr2ks5rb3JngaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279249203, or mute the thread https://github.com/notifications/unsubscribe-auth/AABJ6wBWPVAzkiw88zkOF-leYCbBkx3Iks5rb3UWgaJpZM4L-lwk .

erikh avatar Feb 12 '17 22:02 erikh

Totally. I'm going to have to code it up for my project anyway. Glad you amenable. I can always make a separate package.

On Sun, Feb 12, 2017 at 2:32 PM, Erik Hollensbe [email protected] wrote:

If you feel it's necessary enough for your application, would you be willing to submit a patch that we could discuss?

On Sun, Feb 12, 2017 at 2:30 PM, Erik Hollensbe [email protected] wrote:

Please look at the Value.String methods. they call inspect for the ugly cases, which is probably what Encode would do too.

I don't know if I have a say in this, but otherwise, I don't think this is really worthwhile to add. It's going to be fragile at best and hard to maintain regardless due to all the string mess it'll generate.

@mitchellh?

On Sun, Feb 12, 2017 at 1:09 PM, Mike Gaffney [email protected] wrote:

Piping data into application logic from go, processing it and pulling it back out.

On Feb 12, 2017 12:58, "Erik Hollensbe" [email protected] wrote:

Sorry to be blunt; that seems really fragile. What's the use-case?

On Sun, Feb 12, 2017 at 12:57 PM, Mike Gaffney < [email protected]> wrote:

Was thinking it'd take an interface{} and mostly map maps to hashes and arrays to arrays with primitives mapping normally. I'd leave go structs out initially.

On Feb 12, 2017 12:53, "Erik Hollensbe" [email protected] wrote:

How would that work?

On Sun, Feb 12, 2017 at 11:42 AM, Mike Gaffney < [email protected]

wrote:

If not it'd be nice to have this as well.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55, or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64vhUmHUIZOhYdKhFswcubh8MduRks5rb2CogaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279247929 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLK- iMwyeDtaaq0bJsfZpvrDpUDtdks5rb3FAgaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecommen t-279248217 , or mute the thread <https://github.com/notifications/unsubscribe-auth/ AABJ64wxoSAgwJwnxQDZdw7a508mx9Yrks5rb3I2gaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55# issuecomment-279248271 , or mute the thread <https://github.com/notifications/unsubscribe-auth/AAAvLNGpg MGxi1yyqIPup2tAvNdfBsr2ks5rb3JngaJpZM4L-lwk> .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub <https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279249203 , or mute the thread <https://github.com/notifications/unsubscribe- auth/AABJ6wBWPVAzkiw88zkOF-leYCbBkx3Iks5rb3UWgaJpZM4L-lwk> .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mitchellh/go-mruby/issues/55#issuecomment-279256513, or mute the thread https://github.com/notifications/unsubscribe-auth/AAAvLIKLshSh06rtXve72KoPnzyh2yNoks5rb4iBgaJpZM4L-lwk .

gaffo avatar Feb 12 '17 23:02 gaffo