what's wrong with this code in Dr.Scheme using Pretty Big? i seem to remember doing similar things in the past with no problem.
(lambda (x y) (set! (Frame-variables res) (append (Frame-variables res) (list (cons x y)))))
which returns the following error:
set!: not an identifier in: (Frame-variables res)
if i omit the (set! (Fra...
What's up with this, how do I capture the output from my Gambit-C program?
$ gsi -e "(pp 'hello?)"
hello?
$ gsi -e "(pp 'hello?)" >asdf
hello?
$ gsi -e "(pp 'hello?)" 2>asdf
hello?
$ cat asdf
It should have put the output of the program into asdf, but it's empty!
Is there a compile-time or run-time option I can set to make it treat...
Can you guys think of the shortest and the most idiomatic solution to all-but-one function?
;; all-but-one
;; checks if all but one element in a list holds a certain property
;; (all-but-one even? (list 1 2 4)) -> true
;; (all-but-one even? '(1)) -> true
;; (all-but-one even? '(2 4)) -> false
Edit: all but EXACTLY one.
...
Hi !
I'm struck on a problem with a simple scheme application.
In one file (dataloader.ss), I define a struct :
(define-struct book-category (id name books))
But I can't use the structure in another file.
What I try is, in dataloader.ss, to export the structure with
(provide book-category)
And in the other file, I import :
(requi...
This is a part of a plt-scheme wrapper library:
(define InputMask
(_bitmask '(NoEventMask = #x00000000
KeyPressMask = #x00000001
KeyReleaseMask = #x00000002
...
OwnerGrabButtonMask = #x01000000)
_long))
The thing is I cant figure out ho...
I have a situation where I'd like to do something like...
(define (def a b)
(store a b) ; store the definition of 'a' somewhere
(define-global a b)) ; also define 'a' so that its definition
; is accessible later in the program
Is this possible somehow? As far as I know define-global doesn't exist, so d...
I'm just playing with an NFA for string recognition. I have a macro that creates a function which consumes input and passes on the rest to some other functions. Because there might be loops in my NFA graph, I'm using letrec to put the whole thing together. Here is some code (been testing in PLT-Scheme):
(define-syntax-rule (match chars ...
Which are the most mature and well supported solutions for writing graphical programs?
I have been using C++ with OpenGL/GLUT, but would like to try a more flexible and expressive approach.
Ruby and Processing? Python and OGRE? What things have worked well for you?
...
how to delete an element from a list
ex:- list=[1 2 3 4]
I have come up with some code.I think I got wrong somewhere.
(define delete item
(lambda (list)
(cond
((equal?item (car list)) cdr list)
(cons(car list)(delete item (cdr list))))))
...
Hi I have edited the code for function in scheme that checks whether the length of a list is even.
(define even-length?
(lambda (l)
(cond
((null? l)#f)
((equal? (remainder (length(l)) 2) 0) #t)
(else #f))))
Is it corrrect?
...
Could somebody explain what an "improper list" is?
Note: Thanks to all ! All you guys rock!
...
Working with DrScheme (language-- Pretty Big). Trying to pass the result of an expression to a variable that can later be used in another expression. Here is a simplified version of the problem:
Definitions window:
(define (tot a b c) (+ a b c))
(define (tot2) (+ (tot a b c) 1))
Interpreter window
> (tot 5 6 7)
18
> (tot2)
. ....
Hi!
I am able to delete the element from a list, but I have no idea how to write a function in Scheme to replace all occurences of an element in a list with another element.
Any help will be appreciated.
...
What is the exclusive or functions in scheme? I've tried xor and ^, but both give me an unbound local variable error.
Googling found nothing.
...
Could someone give me a clear distinction between latent and manifest type system?
...
I am developing a small program in Scheme but I got stuck. Is there anything similar to Java's indexOf() that I could use in Scheme?
...
Hello, Is there a way to make a list that holds functions? What I'm trying to do is, make a list of some arithmetic operators (+ - * /) so I can easily manipulate their order and apply them to a list of numbers.
So, if I have that list, I'd use it like this:
(apply (map (lambda (x)
x)
'(+ - * /))
'(1 2...
I am currently reading 'The Little Schemer' and I need a way to test out the Scheme examples in the book on my Windows machine.
With what application can I do this (on Windows, not Linux)?
...
Hi, I am considering which scheme to use.
I would like to use a scheme that has or can be compiled to have no threading support. I have to avoid the layers that threading libs provide. I want an implementation that has no code for interpreter locks, etc. Something that can compile to C is ideal. This will be Unix only. Chicken and Gambi...
I have recently started following the examples from The Little Schemer and when trying out the examples in DrScheme, I have realised that there are some minor syntax changes from the examples in the book to what I can write in DrScheme.
First of all, as a language in DrScheme, I chose Pretty Big (one of the Legacy Languages).
Is this th...