Giter VIP home page Giter VIP logo

Comments (5)

JeffBezanson avatar JeffBezanson commented on April 28, 2024

What should the escaping and interpolation behavior be?

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

Escaping should be:

  1. All traditional C escapes insert the byte they normally represent (in particular, \xff inserts the byte 255).
  2. All Unicode escapes insert their corresponding UTF-8 byte sequence

For interpolation, we should maybe have a bytes(x) function that tries to convert objects to byte arrays and then splices the returned byte array into the middle of the byte array.

Sound reasonable?

from julia.

JeffBezanson avatar JeffBezanson commented on April 28, 2024

And I know just what to do for the default implementation of bytes:

function bytes(x)
  buf = memio()
  write(buf, x)
  takebuf_array(buf)
end

Though it would be much more efficient for byte array interpolation to build its result in a single memio by calling write on each element. In fact we could say the only difference between byte array and string interpolation is that byte arrays use write and strings use print.

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

Yeah, that seems very reasonable. No reason we shouldn't do it like that.

On Tue, Jun 28, 2011 at 3:53 PM, JeffBezanson <
[email protected]>wrote:

And I know just what to do for the default implementation of bytes:

function bytes(x)
buf = memio()
write(buf, x)
takebuf_array(buf)
end

Though it would be much more efficient for byte array interpolation to
build its result in a single memio by calling write on each element. In
fact we could say the only difference between byte array and string
interpolation is that byte arrays use write and strings use print.

Reply to this email directly or view it on GitHub:
#11 (comment)

from julia.

StefanKarpinski avatar StefanKarpinski commented on April 28, 2024

Closed by 6c0f464.

from julia.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.