Giter Site home page Giter Site logo

Comments (3)

larsga avatar larsga commented on June 3, 2024

Only as parameters to the functions declared in the imported JSLT, I'm afraid.

Could you explain the use case?

from jslt.

anuradharajan avatar anuradharajan commented on June 3, 2024

Parent jslt
import "common.jslt" as common
let val1 = "someVal"
common:setVal($val1)

I want to access val1 in my common.jslt

I tried this in common.jslt
let val1 = ""
def setVal(propValue)
val1 = propValue

{
"val1" : ${val1}
}

Getting the following exception
com.schibsted.spt.data.jslt.JsltException: Parse error: Encountered " "let" "let ""
on this line
common:setVal($val1)

from jslt.

larsga avatar larsga commented on June 3, 2024

Thank you, but this is not a use case. This is a full example of trying to do this, but it gives no indication of why you might want to do something like this. The reason I asked is that it's useful to see why you wanted this in the first place. Maybe there is an easier way to achieve the same thing in the language, or maybe there is a good reason why we need to support something like this. Either the way you wanted it, or some other way.

from jslt.

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.