Skip to content

Commit

Permalink
Merge pull request #6 from calcit-lang/abi-version
Browse files Browse the repository at this point in the history
update about abi_version
  • Loading branch information
TCXX authored Oct 28, 2021
2 parents d2d41c7 + eda3155 commit 154ae7b
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "calcit_std"
version = "0.0.5"
version = "0.0.6"
authors = ["jiyinyiyong <[email protected]>"]
edition = "2018"

Expand Down
8 changes: 6 additions & 2 deletions calcit.cirru

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions compact.cirru
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{} (:package |calcit.std)
:configs $ {} (:init-fn |calcit.std.test/main!) (:reload-fn |calcit.std.test/reload!)
:modules $ []
:version |0.0.5
:version |0.0.6
:files $ {}
|calcit.std.test.date $ {}
:ns $ quote
Expand Down Expand Up @@ -223,7 +223,7 @@
defn try-ctrlc! () $ on-ctrl-c
fn () $ println "\"TODO handler..."
|reload! $ quote
defn reload! $
defn reload! () $ println "\"reload not handled yet"
|calcit.std.time $ {}
:ns $ quote
ns calcit.std.time $ :require
Expand Down
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,8 @@ pub use json::{parse_json, stringify_json};
pub use process::execute_command;
pub use regexp::{re_find, re_find_all, re_find_index, re_matches};
pub use time::{set_interval, set_timeout};

#[no_mangle]
pub fn abi_version() -> String {
String::from("0.0.1")
}
3 changes: 3 additions & 0 deletions src/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::time;
pub fn set_timeout(
args: Vec<Edn>,
handler: Arc<dyn Fn(Vec<Edn>) -> Result<Edn, String> + Send + Sync + 'static>,
finish: Box<dyn FnOnce() + Send + Sync + 'static>,
) -> Result<Edn, String> {
if args.len() == 1 {
if let Edn::Number(n) = args[0] {
Expand All @@ -16,6 +17,7 @@ pub fn set_timeout(
if let Err(e) = handler(vec![]) {
println!("error for timeout: {}", e);
}
finish();
});

Ok(Edn::Nil)
Expand All @@ -31,6 +33,7 @@ pub fn set_timeout(
pub fn set_interval(
args: Vec<Edn>,
handler: Arc<dyn Fn(Vec<Edn>) -> Result<Edn, String> + Send + Sync + 'static>,
_finish: Box<dyn FnOnce() + Send + Sync + 'static>,
) -> Result<Edn, String> {
if args.len() == 1 {
if let Edn::Number(n) = args[0] {
Expand Down

0 comments on commit 154ae7b

Please sign in to comment.