GithubHelp home page GithubHelp logo

Comments (9)

adrianVmariano avatar adrianVmariano commented on September 28, 2024

I also get

WARNING: len() parameter could not be converted, in file lib/BOSL/compat.scad, line 75

not sure from what source.

Line 60:
function is_str(v) = (version_num()>=20190303)? is_string(v) : (is_def(v) && is_def(len(v)) && (len(str(v,v)) == len(v)*2));

Line 75:
function is_array(v) = (version_num()>=20190303)? is_list(v) : (!is_str(v) && is_def(len(v)));

from bosl.

revarbat avatar revarbat commented on September 28, 2024

I cannot seem to reproduce this warning.

from bosl.

revarbat avatar revarbat commented on September 28, 2024

Hmm. The code you quoted does not match my code. Can you fetch the dev branch and try again with it?

from bosl.

revarbat avatar revarbat commented on September 28, 2024

My is_def, is_boolean, is_scalar, is_str, and is_array all return the correct results for all value types under both OpenSCAD 2019-03-03 and 2015-03-03

from bosl.

adrianVmariano avatar adrianVmariano commented on September 28, 2024

My version returns 2019 01 0, so it fails all the version tests, which require that the version be larger than this. It appears that is_str() is causing an error message because it calls is_def(len(v)) and for v=1, this prints the above error.

from bosl.

revarbat avatar revarbat commented on September 28, 2024

Really starting to get aggravated at the OpenSCAD developers completely botching their release versioning. I can't change the version test to accept 20190100, because they released an RC2 that reports that version, that doesn't support is_* calls. Yet they released another RC3 that doesn't have is_* calls, but still reports 20190100. AND it throws warnings about len(scalar) now.

And I can't test that version, without having to jump through compilation hoops, because it wasn't released on OS X.

I have an idea, though... Try this definition of is_str:

function is_str(v) = (version_num() > 20190100)? is_string(v) : (v=="" || (is_def(v) && is_def(v[0]) && (len(str(v,v)) == len(v)*2)));

from bosl.

revarbat avatar revarbat commented on September 28, 2024

Should be fixed in master branch commit 57adf91

from bosl.

adrianVmariano avatar adrianVmariano commented on September 28, 2024

I tried the previous code that produced the warning and it's no longer doing it.

from bosl.

revarbat avatar revarbat commented on September 28, 2024

Closing!

from bosl.

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.