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

  • Home
  • SEARCH
  • 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 7997263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:55:54+00:00 2026-06-04T14:55:54+00:00

Minimal example is really the 2nd example from Rings main page requirerings local init_cmd

  • 0

Minimal example is really the 2nd example from Rings main page

require"rings"

local init_cmd = [[
require"stable"]]

local count_cmd = [[
count = stable.get"shared_counter" or 0
stable.set ("shared_counter", count + 1)
return count
]]

S = rings.new () -- new state
assert(S:dostring (init_cmd))
print (S:dostring (count_cmd)) -- true, 0
print (S:dostring (count_cmd)) -- true, 1
S:close ()

S = rings.new () -- another new state
assert (S:dostring (init_cmd))
print (S:dostring (count_cmd)) -- true, 2
S:close ()

However, I’m not able to get value of shared_counter. print(shared_counter) outputs nil.

I’ve tried to use stable.get(), but it says stable can only be used in slave states.
I finally tried

remotedostring("shared_counter = "..count)

Which worked, but I’m not quite sure if it’s a proper way to do it. I guess direct access to stable value table would be sufficent?

EDIT: Oh, and I forgot to add, that the main part of the problem is communicating in the other way – from master to slave.

  • 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-04T14:55:55+00:00Added an answer on June 4, 2026 at 2:55 pm

    The stable library stores the values in a global table in the master state called _state_persistent_table_. Though obviously this is meant to be hidden and private.

    If you’re uncomfortable with this, stable just uses remotedostring() internally, and it would not be hard to do something like that yourself.

    For master->slave, slave:dostring() should suffice, using similar techniques.

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

Sidebar

Related Questions

This is a minimal example taken from the Reflection-0.5. {-# LANGUAGE Rank2Types, MultiParamTypeClasses, FunctionalDependencies,
What is the really minimal example of Silverlight application? For example, I made the
Anyone have an minimal example of ASP.NET MVC and dotnetcharting.com control lying around? Thanks,
EDIT I isolated a real minimal example which does not work (it is a
Edit: a minimal project that exhibits the crash can be downloaded from crashTest .
Minimal example dialog: <p:dialog header=Test Dialog widgetVar=testDialog> <h:form> <p:inputText value=#{mbean.someValue}/> <p:commandButton value=Save onsuccess=testDialog.hide() actionListener=#{mbean.saveMethod}/>
The minimal example of the problem I'm having is reproduced below: #include <set> using
Here is an minimal example of the error I get. If I understood the
Let us take this example scenario: There exists a really complex function that involves
This is copied example from: How to read custom config section in app.config in

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.