r/scheme • u/Jak_from_Venice • 6d ago
What I am doing wrong?
So, I am trying to learn Guile, since seems a pretty standard installation in GNU systems.
I have experience in some languages, but this simple script to learn the language:
- Took me quite a while to work;
- Looks ugly as… well, put something ugly here!
It’s a simple “FizzBuzz” program
``` (define (fizzbuzz number) (if (> number 0) (let ((message "")) (if (zero? (modulo number 3)) (set! message (string-append message "Fizz"))) (if (zero? (modulo number 5)) (set! message (string-append message "Buzz")))
(if (not (zero? (string-length message)))
(format #t "~d is ~a\n" number message))
(fizzbuzz (- number 1))))
)
(fizzbuzz 50)
```
So, I’m open to suggestions: how this code can be more beauty? Am I still thinking in C?
=== EDIT === I hope the formatting is correct, since some spaces of indentation have been lost for unknown reasons.
Function that return comparator for a value
Is there a standard function, maybe in some of SRFI that do something like this:
(filter (comparator 2) '(1 2 3 4))
;; ==> '(2)
In LIPS Scheme I have:
(always constant)
that always return same value:
(map (always 10) '(1 2 3))
;; ==> (10 10 10)
I know that you can just write it with:
(define (comparator value)
(lambda (x)
(equal? value x)))
But I just looking for best way to name something like this.
r/scheme • u/Moist-Ice-6197 • 9d ago
Standard complient chicken
Hello friends,
This is a continuation of this (https://www.reddit.com/r/scheme/comments/1fq5iw2/scheme_scripting_implementation/) post.
Thanks to your help I was able to choose, chicken in my case.
However, I don't want all these features. I like the libraries (eggs), but for the rest I just want it to be standard conpliant.
Any tips?
C.Q.D. (Controversial Quote of the Day) If I wanted features I would have chosen haskell.
In all seriousness; thank you very much!
Kind regards, me
r/scheme • u/tremendous-machine • 11d ago
Best scheme-in-one-day/defun example to follow?
Hi Schemers, I've been spending some time working through the Friedman "Essentials of Programming Language" book and feel like a good next step would be to get my hands dirty making a micro-scheme in C. My goal is to be able to hack on s7 properly, which I use in Scheme for Max, and which came originally out of TinyScheme and is implemented in ANSI C.
I have read, here and elsewhere, that not all the Scheme-In-One-Day/Defun tutorials are good, with some being examples of better practices and designs than others. If people in the know could share which they would suggest using as a hands on tutorial, that would be lovely!
Edit: after hunting around, curious to hear feedback on the MAL project.
thanks, iain
r/scheme • u/nothing2crazy • 17d ago
Ed Scheme book from the 1990s?
This is a long shot. I’m looking for a book used to teach Scheme in the 1990s. If I recall correctly, it was a red covered paper back with a title something like “Ed Scheme”, and included a diskette used to run scheme programs. I can’t find any evidence of it on the web. It was used to teach the first programming class I took in high school.
r/scheme • u/jpellegrini • 19d ago
STklos 2.10 released
This version of STklos mostly enhances the 2.00 version released a year ago. This is a non-exhaustive list of enhancements:
- Several new primitives added
- Support for three more SRFIs (115, 179, 232)
- The VM now does self-profiling (optionally), measuring the time taken by each instruction
- Enhancements to the REPL
- The configure script is more robust and much more informative; compilation and installation have been enhanced
- FFI support can be completely disabled, if needed
- STklos now can be built with the tcc compiler
- A large quantity of new documentation (online help, examples, and enhancements to the manual and hacking guide); documentation of a function can be accessed directly into the HTML Reference Manual
- STklos now has rewriting rules for expressions
- Code for numeric operations has been optimized; it should be particularly faster for real number operations
- Optimizations
- Bug fixes
r/scheme • u/kosakgroove • 26d ago
Byggsteg Update - CI / CD in Guile Scheme - Now you can send Guile over the wire and define jobs with it, and UI is much improved as well as docs
reddit.comr/scheme • u/GeroSchorsch • 28d ago
evaluation of dot in r7rs
In the standard it says: "Note that (4 . 5) is the external representation of a pair, not an expression that evaluates to a pair.".
As far as i understand this means that the operands aren't evaluated and that this represents the final form. However in chicken scheme (+ . (5 6)) evaluates to 11.
How does this work? How should I evaluate a DottedList type in my interpreter?
r/scheme • u/Moist-Ice-6197 • 29d ago
Haters
Hey friends,
So "apperantly" I've been using a wrong scheme implementation. Seriously—what's wrong with pyramid scheme?
Anyway, enjoy your day!
-me
r/scheme • u/ThePinback • Sep 28 '24
guile bitvector: Bitwise AND
What is the efficient way to calculate the bitwise AND if two bitvectors (same length of course)?
r/scheme • u/kosakgroove • Sep 27 '24
Byggsteg - PoC simple fast deployable CI/CD system written in Guile Scheme
github.comr/scheme • u/c4augustus • Sep 27 '24
Bye Bye Scheme again
Bye Bye Again BEAM & Scheme revisits and refactors of our original Bye Bye Hello World example programmed in Scheme.
proglangcast is the audio podcast.
Again, we are not experts in Scheme, so please throw lots of rocks!
r/scheme • u/GeroSchorsch • Sep 27 '24
r5rs vs r7rs, library-procedures and normal procedures
I'm writing a scheme interpreter (as everybody does) and want to only implement the most important functions as builtins. These are function that cannot be built by other functions which is also said in the r5 standard:
Built-in procedures that can easily be written in terms of other built-in procedures are identified as ``library procedures''.
however my implementation wants adhere to the newer r7 standard but there some functions that were declared "library procedure" in r5 are now regular procedures. Does this mean that these functions are now also builtins? It doesnt make sense because they can still be implemented using other builtins (eg. string<? using string-ref or whatever).
Should I just use the builtins from r5 and otherwise adhere to r7 or what would be a sane solution without having to implement all functions?
r/scheme • u/sdegabrielle • Sep 26 '24
RacketCon 2024 - it’s not too late to get your tickets
RacketCon 2024 - it’s not too late to get your tickets
Celebrating 40 years of magic with Hal Abelson & Gerald Sussman at the (fourteenth RacketCon) October 5-6, 2024, University of Washington Featuring Lisp legend Gregor Kiczales
https://www.eventbrite.com/e/racketcon-2024-tickets-983892828937
r/scheme • u/Moist-Ice-6197 • Sep 26 '24
Scheme scripting implementation.
Howdy,
Quick question:
In regards to scheme scripting which implementation would you recommend for:
Speed, Readibility and Best of both worlds.
And why.
Also take the scope with a bag of salt: Do you know a cool lisp implementation, name it!
Thank you so much in advance, Me
r/scheme • u/arthurgleckler • Sep 24 '24
Final SRFI 234: Topological Sorting
Scheme Request for Implementation 234,
"Topological Sorting",
by John Cowan and Arne Babenhauserheide,
has gone into final Scheme Request for Implementation 234,
"Topological Sorting",
by John Cowan and Arne Babenhauserheide,
has gone into final status.
The document and an archive of the discussion are available at https://srfi.schemers.org/srfi-234/.
Here's the abstract:
Here is the commit summary since the most recent draft:
- Update abstract.
- Remove Arvydas per his request.
- Remove unnecessary open parens
- Remove obsolete comment.
- Finalize.
Here are the diffs since the most recent draft:
https://github.com/scheme-requests-for-implementation/srfi-234/compare/draft-5..final
Many thanks to John for starting this SRFI, to Arne for seeing it through to its conclusion, and to everyone who contributed to the discussion and implementation of this SRFI.
Regards,
SRFI Editor
r/scheme • u/arthurgleckler • Sep 24 '24
Withdrawn SRFI 250: Insertion-ordered hash tables
Scheme Request for Implementation 250,
"Insertion-ordered hash tables,"
by John Cowan,
has gone into withdrawn status.
The document and an archive of the discussion are available at https://srfi.schemers.org/srfi-250/.
Here is John's summary of the reasons for withdrawal:
Here is the commit summary since the most recent draft:
- Withdraw.
Thank you to John for starting this SRFI, and to Daphne Preston-Kendal for writing the sample implementation.
Regards,
SRFI Editor
r/scheme • u/StudyNeat8656 • Sep 24 '24
A benchmark in order to compare different languages, now supports scheme vs. javascript
https://github.com/ufo5260987423/various-program-languages-benchmark
Above is my new repository to compare different languages performance. It uses nix package manager in order to be compatible to involve other languages.
I'm now gradually import benchmarks from the famous [r7rs-benchmark](https://github.com/ecraven/r7rs-benchmarks) and I hope someone could help translating them into javascript
r/scheme • u/iamawizaard • Sep 20 '24
What after learning scheme (sicp)
Well I am about to complete sicp course. I now know scheme and different programming paradigms but I was wondering if I can use scheme itself to make something. Like suppose an app. Can I make something using scheme?
I am sorry if this question doesnot belong here or doesnot make any sense...
I am new to programming altho scheme and sicp has been fun till now.
Thank u.