GithubHelp home page GithubHelp logo

Comments (5)

XAMPPRocky avatar XAMPPRocky commented on June 3, 2024 1

But I don't mind if we just consider more optimisation here. I don't see many use cases why someone would want that error.

Yeah I think for now, let's leave it, we can still validate COER through our tests. I think is someone can provide a compelling use case, then we can change. Because right now, the other codecs do the same thing where if the value provided is the default, it's just passed along and we don't check.

from rasn.

XAMPPRocky avatar XAMPPRocky commented on June 3, 2024

On same cases codec decoder might want to rise an error if the default is encoded as value when it should be omitted.

Is this a meaningful case? Like is there a case where it's better to present an error when presented with a value that matches the default?

from rasn.

Nicceboy avatar Nicceboy commented on June 3, 2024

When looking the COER encoding rules, there is section:

31.9 In the encoding of a sequence or set type, each component that is marked DEFAULT shall be encoded as absent if its value is identical to the default value.

I am not sure how to handle this on decoder side, but I would assume that it is error if there is default value instead of omitting it.

from rasn.

XAMPPRocky avatar XAMPPRocky commented on June 3, 2024

I am not sure how to handle this on decoder side, but I would assume that it is error if there is default value instead of omitting it.

I don't know if I would assume that, an encoder is supposed to omit it, but I feel like it's more intuitive for the decoder to accept, it's not like (correct me if I'm wrong), that we can take advantage of an optimisation here, because in order to know if it's the default value, we have to decode it anyway, and by that point we have already all the work.

from rasn.

Nicceboy avatar Nicceboy commented on June 3, 2024

I don't know if I would assume that, an encoder is supposed to omit it, but I feel like it's more intuitive for the decoder to accept, it's not like (correct me if I'm wrong), that we can take advantage of an optimisation here, because in order to know if it's the default value, we have to decode it anyway, and by that point we have already all the work.

That is certaintly true from performance point.
I am trying to make distinction between OER and COER decoder (OER happily decodes defaults), so that what is left for COER is to strictly validate if the input is produced by COER encoder.

But I don't mind if we just consider more optimisation here. I don't see many use cases why someone would want that error.

from rasn.

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.