xo-umbrella2/xo-reader/include/xo/reader/envframe.hpp
Roland Conybeare 510fbdc578 git subrepo clone (merge) git@github.com:Rconybea/xo-reader.git xo-reader
subrepo:
  subdir:   "xo-reader"
  merged:   "cb652195"
upstream:
  origin:   "git@github.com:Rconybea/xo-reader.git"
  branch:   "main"
  commit:   "cb652195"
git-subrepo:
  version:  "0.4.9"
  origin:   "???"
  commit:   "???"
2026-06-06 22:23:57 -04:00

60 lines
1.6 KiB
C++

/* file envframe.hpp
*
* author: Roland Conybeare, Aug 2024
*/
#pragma once
xxx;
#include "xo/expression/Variable.hpp"
#include "xo/expression/LocalSymtab.hpp"
#include <vector>
namespace xo {
namespace scm {
#ifdef OBSOLETE
/** @class envframe
* @brief names/types of formal paremeters introduced by a function
*
*
**/
class envframe {
public:
using Environment = xo::scm::Environment;
using LocalEnv = xo::scm::LocalEnv;
using Variable = xo::scm::Variable;
public:
envframe() = default;
envframe(const std::vector<rp<Variable>> & argl, const rp<Environment> & parent_env);
const std::vector<rp<Variable>> & argl() const { return env_->argv(); }
const rp<LocalEnv> & local_env() const { return env_; }
/** lookup variable by @p name. If found, return it.
* Otherwise return nullptr
**/
bp<Variable> lookup(const std::string & name) const;
/** establish (replacing if already exists) binding for variable @p var.
* Replacement intended for use in interactive sessions
**/
void upsert(bp<Variable> var);
void print (std::ostream & os) const;
private:
rp<LocalEnv> env_;
};
inline std::ostream &
operator<< (std::ostream & os, const envframe & x) {
x.print(os);
return os;
}
#endif
} /*namespace scm*/
} /*namespace xo*/
/* end envframe.hpp */