Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9109741
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T03:06:58+00:00 2026-06-17T03:06:58+00:00

_ENV currently hates using classes. I’m attempting to create a Latin kind of Lua,

  • 0

_ENV currently hates using classes. I’m attempting to create a Latin kind of Lua, and some things can’t precisely be made with _ENV but it’s a lot more efficient. setfenv was being uncooperative as well.
The subsequent code keeps returning the old attempt to call a nil value error. It specifies line 20, in which loadstring() is being checked, and line 23, where in the main chunk it is calling the __latin() function.

function __latin(code)
    __predecessor = [===[
    function typographia(value)
        print(value); 
    end

    chorda = {};
    chorda.__index = chorda; 

    function chorda.sub(chorda, cChorda, fChorda)
        return string.sub(chorda, cChorda, fChorda); 
    end
    function chorda:sub(chorda, cChorda, fChorda)
        return string.sub(chorda, cChorda, fChorda);
    end

    --[[ define values --]]
    _ENV = {salve="Salve, munde!",typographia=typographia,print=print,chorda=chorda,chorda.sub=chorda.sub};  ]===]; 
    __finalizer = __predecessor .. " " .. code; 
    local status, err = pcall(loadstring(__finalizer));
    print(err); 
    if (err == nil) then loadstring(__finalizer)(); end 
end
__latin('typographia(salve); chorda.sub(salve, 1, 3);'); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T03:07:00+00:00Added an answer on June 17, 2026 at 3:07 am

    You’re getting “attempt to call a nil value” because loadstring returns nil (so you’re calling pcall with nil). loadstring returns nil because the code you’re compiling (__predecessor) contains invalid Lua:

    _ENV = {
        chorda.sub = chorda.sub -- can't do this
    }
    

    FYI: The loadstring/pcall stuff is irrelevant to your problem. Had you stripped it out before posting, you would have found this error yourself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coding a shell currently and for some reason I can't get my printenv
I'm currently programming an interface between some C++ code and Java using JNI. I'm
I'm currently trying to implement some kind of file browser / explorer into a
Currently I am working on project like web analytic using rails 3.2.3 I have
I am using KornShell (ksh) on Solaris and currently my PS1 env var is:
I am currently using libproxy to get the proxy information (if any) on RedHat
I'm currently using both C++ and Java in a project and I'd like to
I am currently developing a Scala framework for multi-process, parallel algorithms using MPJ-Express (i.e.
I am currently using VMC version 0.4.3 and it seems that the following command
Currently, I have several environments which are loaded using NODE_ENV (I'm using RailwayJS /

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.