Skip to content

Commit 0c55044

Browse files
committed
🦀
1 parent 3349072 commit 0c55044

File tree

8 files changed

+11
-0
lines changed

8 files changed

+11
-0
lines changed

src/default_environment.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ pub fn default_env() -> Env {
200200
}),
201201
);
202202

203+
// 🦀 Oh the poor `filter`, you must feel really sad being unused.
203204
// entries.insert(
204205
// String::from("filter"),
205206
// Value::NativeFunc(

src/interpreter.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ fn eval_inner(
301301

302302
result
303303
}
304+
// 🦀 Boo! Did I scare ya? Haha!
304305

305306
/// Calling a function is separated from the main `eval_inner()` function
306307
/// so that tail calls can be evaluated without just returning themselves

src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ use std::io::Write;
1616
use std::{cell::RefCell, io, rc::Rc};
1717

1818

19+
// 🦀 I am all over this project!
1920
/// Starts a REPL prompt at stdin/stdout. **This will block the current thread.**
2021
pub fn start_repl(env: Option<Env>) {
2122
let env_rc = Rc::new(RefCell::new(env.unwrap_or_else(default_env)));

src/macros.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ macro_rules! lisp {
4242
};
4343

4444

45+
// 🦀 Very special!
4546
// Special atoms
4647
(Nil) => { Value::NIL };
4748
(T) => { Value::T };

src/main.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ use std::{cell::RefCell, rc::Rc};
1212

1313
use rust_lisp::{default_env, eval_block, parse, start_repl};
1414

15+
// 🦀 Try finding me! I'm hidden all around the code!
16+
1517
fn main() {
1618
match std::env::args().nth(1) {
1719
Some(code) => {

src/model.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ impl Display for Value {
146146
}
147147
}
148148

149+
// 🦀 Ferris blesses the Debug trait
149150
impl Debug for Value {
150151
fn fmt(&self, formatter: &mut std::fmt::Formatter) -> std::fmt::Result {
151152
match self {
@@ -473,6 +474,8 @@ impl PartialEq for Lambda {
473474
/// The trait bound for any Rust function that is to be called from lisp code
474475
type NativeFunc = fn(env: Rc<RefCell<Env>>, args: &Vec<Value>) -> Result<Value, RuntimeError>;
475476

477+
// 🦀 Ferris thinks... Maybe we should turn this struct into enum? Some things we can put in stack
478+
// rather than allocating memory for yet another `String`
476479
#[derive(Debug, Clone)]
477480
pub struct RuntimeError {
478481
pub msg: String,

src/parser.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ fn tokenize_simplest() {
155155
assert_eq!(tokens, vec!["(", "1", "2", "3", ")"]);
156156
}
157157

158+
// 🦀 Testing, testing!
158159
#[test]
159160
fn tokenize_basic_expression() {
160161
let source = "

src/utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use crate::model::{Value, RuntimeError, List, IntType, FloatType};
22

3+
// 🦀 Poor thing, you went unused too?
34
// pub struct ArgumentError {
45
// msg: String,
56
// index: usize,

0 commit comments

Comments
 (0)