Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Team: elucent #330

Open
sophiajt opened this issue Aug 23, 2021 · 3 comments
Open

Team: elucent #330

sophiajt opened this issue Aug 23, 2021 · 3 comments

Comments

@sophiajt
Copy link
Contributor

sophiajt commented Aug 23, 2021

Add your votes to this issue by using emoji reactions

You can find this team's project at: https://github.com/langjam/jam0001/tree/main/elucent

@vic
Copy link
Contributor

vic commented Aug 24, 2021

@classerase, remember that only 👍 emojis are valid for voting :) so perhaps you'd like to vote again.

@vic
Copy link
Contributor

vic commented Aug 24, 2021

Hey @elucent, thanks for making smal, love to see more people doing stack/concatenative languages. I'd have loved to write a nice documentation as yours ^^.

@asrp
Copy link
Contributor

asrp commented Aug 28, 2021

Very nice design. I don't quite get how in and defining binary function works.

fn mod15 [
  in [a]
  [b] = 15
  putv([mod15 a =]) putv(a)
  putv([mod15 b =]) putv(b)
  if (a < b) [a] [mod15(a - b)]
]
fn mod [
  in [a]
  in [b]
  putv([mod a =]) putv(a)
  putv([mod b =]) putv(b)
  if (a < b) [a] [
    [c] = a - b
    (mod c b)]
]
putv(mod15 100)
putv(mod 100 15)

shows

mod15 a =
100
mod15 b =
15
mod15 a =
85
mod15 b =
15
mod15 a =
70
mod15 b =
15
mod15 a =
55
mod15 b =
15
mod15 a =
40
mod15 b =
15
mod15 a =
25
mod15 b =
15
mod15 a =
10
mod15 b =
15
10
mod a =
100
mod b =
15

instead of the same result for both calls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants