Category "scheme"

Is there a way to run guile function from command line

So I have a simple file.scm file with following code in it: #!/usr/bin/guile -s !# (define (printer arg) (display arg)) I know you can execute it inside gui

Modified Sieve for finding Prime Numbers in Scheme

I am working on coming up with a solution for coming with a list of prime numbers using the Sieve of Eratosthenes. So the program is supposed to find prime numb

SICP Exercise 2.5 - How if it needs a modification?

I'm currently reading the SICP, and working on Exercise 2.5 : Exercise 2.5. Show that we can represent pairs of nonnegative integers using only numbers and ari

Is CallCC an improved version of goto?

My background is Javascript, Python & a bit of Haskell. I am trying to understand callCC, there are many explanations but I can't find them trivial & I

How to implement continuations in dynamic language like JavaScript?

I need some hits how I should go about and implement continuation for lips in JavaScript (my lisp is almost like scheme, except no continuations and TOC). Here

How to implement outer product of two vectors in Scheme?

I want to define a function in Scheme that will compute the outer product of two vectors. for example: (outerProduct '(1 2 3) '(4 5)) the output is supposed to

How to get the first, middle and last element of a list scheme and prolog?

I am trying to write a function in Scheme and Prolog that returns first, middle and last item of a list. E.g., find([4,5,8,7,9],L), L = [4,8,9]. I came up with

SICP exercise 3.20 - understand the envrionmental diagram (missing binding in my diagram)

There was a question regarding this exercise in this forum, but it dose not answer my specific question. This exercise asks to draw the environmental diagrams f

How to get the multiplication of two lists in Lisp or Scheme?

I think I'd have to dig into SICP later, but if it is two lists: a b c d 1 2 3 Is there a standard way to get the multiplication of them in 2, 3 or 4 lines? So

Why is there no tail recursion optimization in Emacs lisp, not but like other scheme?

Emacs lisp is a dialect of LISP and especially Scheme. Most of scheme interpreters do have a optimization of Tail Recursion, but emacs lisp doens't. I searched

removing last element of a list(scheme)

So I have to remove the last element of a list in scheme. For example, let's say I have a list (1 2 3 4). I need to return: (1 2 3) My idea: reverse(list)