The duplication is because you're evaluating the expression at top
level, so the repl is part of the continuation. The continuation isn't
(lambda (c) (c e2); it's actually something like (lambda (c)
(evaluate-in-repl (c e2)). So when you run (ret 9), you're actually
re-running the repl you had when
Another, less lightweight way is to use panels for different parts of
the chat windows. I put together a sample at
https://gist.github.com/zamora/1cfc6480f7703735dffa3169facfbf10
On Mon, Aug 10, 2020 at 3:32 PM Christopher Lemmer Webber
wrote:
>
> Hello,
>
> I'm building a little chat application
Racket doesn't implement hash tables using a hash function. If I
recall correctly, it uses b-trees as the representation for a hash
table. The Racket reference states that "Immutable hash tables
actually provide O(log N) access and update. Since N is limited by the
address space so that log N is l
[Apologies if this gets sent twice. I accidentally sent the first one
to the googlegroups email address]
Stephen De Gabrielle announced this a few days ago on racket-dev, so I
spent my weekend embracing my inner Star Wars nerd and made
lightsabers in Racket. I had never used the pict library befor
Stephen De Gabrielle announced this a few days ago on racket-dev, so I
spent my weekend embracing my inner Star Wars nerd and made
lightsabers in Racket. I had never used the pict library before, so it
was also an interesting learning experience.
I created a lightsaber function that produces a pic
On Thu, Jul 18, 2019 at 1:48 PM Brian Adkins wrote:
> I think more people (both existing users and new users) could get
> excited about Racket2 if it was primarily about making Racket
> objectively better and only secondarily about overcoming the
> aesthetic objection to parens. The message of "Af
On Tue, Mar 19, 2019 at 10:35 PM Ben Greenman
wrote:
> I'm thinking a color-map% object would define a possibly-infinite
> sequence of colors that look nice in some way. The colors might be
> useful anywhere where someone wants a "rainbow" of colors ... maybe
> for:
If you're interested in contra
You should include Danny Yoo's Brainfudge in the "stand-alone
languages with non-s-exp syntax".
https://www.hashcollision.org/brainfudge/index.html
Justin
On Fri, Mar 1, 2019 at 6:15 PM Stephen De Gabrielle
wrote:
>
>
>
> On Fri, 1 Mar 2019 at 18:00, Matthias Felleisen
> wrote:
>>
>>
>>
>> > O
Thanks! I always forget about archive.org!
Justin
On Sat, Feb 2, 2019 at 3:29 PM Greg Trzeciak wrote:
>
> Try
>
> https://web.archive.org/web/20181228174204/http://www.ccs.neu.edu/home/matthias/HtDC/htdc.pdf
>
> On Saturday, February 2, 2019 at 9:26:15 PM UTC+1, Justin Zam
I tried to download the draft of "How to Design Classes" from
http://www.ccs.neu.edu/home/matthias/htdc.html and got a "Failed to
load PDF document" error. Is this text still available?
Justin
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To
There are many characters that have different Unicode values but use the
same glyphs. Many Cyrillic characters look like their English characters,
so they appear the same visually, but equal? and eq? reveal that they are
actually distinct. It seems to be that the BOM is just another example on
this
On Thu, Apr 27, 2017 at 8:06 PM, Jon Zeppieri wrote:
>
> OCaml does handle tail calls properly. But proper tails calls are not
> the subject of this discussion. The original post was explicitly about
> non-tail calls and how, in Racket, you cannot exhaust the stack
> without exhausting all of the
I think you are looking for something like this:
#lang racket
(require test-engine/racket-tests)
(define (remove-empty-lists lst)
(cond
[(null? lst) '()] ; Check for end of list
[(null? (first lst)) (remove-empty-lists (rest lst))] ; Skip null
sublist
[(not (list? (first lst))) ; L
A clue to the answer is in your statement that you "feed that [maximum]
into the next circle of recursion." Notice that you're not overwriting the
value in the current call, you're creating a new value that you feed into
the new call in the "next circle". So the old one isn't being overwritten
at a
You can also try using a state machine using the approach described in
https://cs.brown.edu/~sk/Publications/Papers/Published/sk-automata-macros/paper.pdf
On Feb 22, 2016 4:46 PM, "Federico Ramírez" wrote:
> Hello everyone! I'm new to Scheme, and I need some help wrapping my head
> around it.
>
>
The sequence C-a C-x C-s does something very different when Emacs
keybindings are not active. :(
Justin
--
You received this message because you are subscribed to the Google Groups
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to racket-u
Why not use streams? http://docs.racket-lang.org/reference/streams.html
Justin
On Apr 9, 2015 11:22 AM, "Jerry Jackson" wrote:
> Hello,
>
> I'm building a language with racket that includes lazy lists. I'm building
> lazy lists with mcons cells. The compatibility/mlist module has lots of
> suppo
There is also Clojure on Android, which might be a promising alternative.
http://clojure-android.info/
Justin
On Feb 21, 2015 1:24 PM, "Darren Cruse" wrote:
> I could chime in I've also been interesting in Racket for mobile apps.
> Though I've just been learning Racket (and scheme) the last few
> structure type (assuming that the structure type is not prefab), which
> leads to the same problem for the deserializer.
>
> So, `define-serializable-struct` needs to be used outside of a
> signature and outside of any unit. It could be in its own module, for
> example.
>
&
struct (a b c))
>
> [You can also use the struct syntax but you then need to define the
> alternative constructor.]
>
> ;; -
> I recommend developing small units in one DrRacket buffer. It's the
> easiest way to get used to their syntax.
>
There seems to be a problem exporting struct constructors when using #lang
racket/signature. This works:
- b-sig.rkt-
#lang racket
(define-signature b^
((struct my-struct (a b c))
b-value))
(provide b^)
- b-unit.rkt -
#lang racket/unit
(require "b-sig.rkt")
(import)
(expo
I am writing a program using units and got this message:
define-signature: unknown signature form in: serializable-struct
Sure enough, the docs show that serializable-struct is not allowed in a
signature. Is this something that can be fixed or do I have to work around
it (maybe by using regular st
You should learn about Model-View-Controller architecture (for example at
http://en.m.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller).
Briefly, the model is a data structure that represents the information you
are working with. The view is able to produce a visual representation of
the m
..) or block instead.
>
>
> http://docs.racket-lang.org/reference/block.html?q=block#%28form._%28%28lib._racket%2Fblock..rkt%29._block%29%29
>
> /soegaard
>
>
> 2014-03-16 21:38 GMT+01:00 Justin Zamora :
> > What is the reason for not allowing internal definitions in the &q
What is the reason for not allowing internal definitions in the "then" and
"else" parts of an "if"?
This fails with "define: not allowed in an expression context":
(if (< 3 4)
5
(begin
(define a 7)
a))
But the equivalent "cond" works fine:
(cond
[(< 3 4) 5]
[else (define a
On Feb 5, 2014 10:02 AM, "Pierpaolo Bernardi" wrote:
>
> Can you make an example of something that's worse than C?
>
Perl
Justin
Racket Users list:
http://lists.racket-lang.org/users
Your comment says that y-or-n? returns either #t or #f. I see the line
where you return #t. Where do you return #f?
Justin
On Dec 30, 2013 4:04 PM, "亀田馬志" wrote:
> Hello.
>
> I think I understand how memq, memv, member works:
>
> > (memq 'y '(y yes n no))
> '(y yes n no)
> > (memq 'n '(y yes n n
On Feb 10, 2013 5:51 PM, "Da Gamer" wrote:
> Third, as someone who hasn't been in the Racket community long but knows
that it is a Scheme variant, I don't see why there is an issue of asking
such a question. Is there any need to be defensive and hostile? I can't see
the idea being that outrageous,
On Dec 19, 2012 11:02 PM, "Matt Jadud" wrote:
> And, watching a bunch of the videos, they are funny because they are
*extremely* over the top. "He dates all the girls in the CS department"
isn't over-the-top, and just came across slightly skeezy.
I tend to agree. I was expecting a joke at this po
Select "Use Horizontal Layout" in the View menu.
Justin
On Dec 12, 2012 9:17 PM, "Da Gamer" wrote:
> The way it is now -- file on top and instarepl at the bottom -- is ok. But
> I was wondering if the instarepl view could be also set so it is vertical
> as well. Somewhat like a split screen view
I think you hit on the distinction when you use the terms "procedure" and
"procedure application". It is correct to say that a procedure returns a
value and that an application of that procedure has a value. (since Scheme
has first-class procedures, it's also true that a procedure has a value,
but
How can I put frames inside of a master frame to implement multiple
documents (e.g. http://images.appleinsider.com/win7task-090206-7.png)?
Justin
Racket Users list:
http://lists.racket-lang.org/users
You can use something like this:
(define (all-lower-case? str)
(string=? str (string-downcase str)))
> (all-lower-case? "haha")
#t
> (all-lower-case? "haHa")
#f
Justin
On Fri, Jul 13, 2012 at 9:02 AM, Rouben Rostamian wrote:
> The function `all-lower-case?' defined below takes a string and
>
In my experience, the heaviness of Racket doesn't come from words like
"define", etc. It comes in certain categories of programs that deal
extensively with strings, vectors, and structured data. For example,
initials = person[i].firstname[0] + person[i].lastname[0]
This is very readable and use
This is a great situation to use Racket's advanced list
comprehensions. There is no need to use set!. You can keep track of
the maximum as you loop. Here is my solution.
; Problem 4
; Find the largest palindrome made from the product of two 3-digit numbers.
; 3-digit numbers are the numbers 100
Is the dc% that is passed to the paint-callback for a canvas always
the same dc% returned by (send canvas get-dc)? In other words, are
the following equivalent?
[paint-callback (lambda (canvas dc) (send dc clear))]
[paint-callback (lambda (canvas dc) (send (send canvas get-dc) clear))]
Justin
__
I'd like to be able to write something like this:
(let loop ([a 1] [b 2])
(if (= a b)
3
(loop (values (add1 a) b
This would match the way for/fold works with more than one value.
However, I get a message, "context expected 1 value, received 2
values: 2 2", which makes sense giv
Is there a built in way to exit the various kinds of for loops early?
I've been using code like:
(let/ec break
(for ([i (in-range 1 100)]
#:when (condition? i))
(break i
Is there a better way?
Justin
_
For list-related admi
On Thu, Jun 23, 2011 at 11:56 AM, Danny Yoo wrote:
> I'd like to be able to inject some HTML fragments into a Scribble
> document, so that when the Scribble documentation renders to html,
> those fragments are carried along.
+1
It would also be useful for putting tags to insert video into
Scrib
ram Krishnamurthi
> wrote:
>>
>> Also note that if you programmed in the Student Language levels, this
>> function would be illegal (and it might give you some insight into how
>> this programming style works).
>>
>> On Wed, Jun 1, 2011 at 9:19 PM, Justi
On Wed, Jun 1, 2011 at 7:22 PM, Yingjian Ma wrote:
>
> In my question
> (define (p x)
> (+ x 10)
> (* x 10)
> )
> It seems it only executes (* x 10)
No, it executes both of them. It evaluates (+ x 10), then throws away
the value it just computed. Then it evaluated (* x 10), since that is
You'll want to read http://docs.racket-lang.org/reference/reader.html
In particular, section 12.6.4, "A #true, #t, #T followed by a
delimiter is the input syntax for the boolean constant 'true'.
Section 12.6.4 talks about what can be used as a delimiter. Your
example fails because + is not a delim
In December, Jens Axel Søgaard asked about embedding a YouTube video
in the Scribble HTML output:
> It (finally) dawned on me that I have two problems.
> I thougt this would display a YouTube player on the HTML page:
>
> @exact|{ type="text/html" width="480" height="390"
> src="http://www.youtube.c
The stepper works fine on simple programs. You can try watching this
video tutorial I made for my students. It's basic, but it covers the
essentials of using the stepper.
http://www.youtube.com/watch?v=j3X07a-7YRM
Justin
On Sun, Jan 9, 2011 at 9:02 AM, Sayth Renshaw wrote:
> I am having a real
There is one in Kent Dybvig's book, "The Scheme Programming Language."
It's online at
http://www.scheme.com/tspl3/examples.html#./examples:h10
Justin
On Fri, Dec 10, 2010 at 5:33 PM, YC wrote:
> Hi all -
> does anyone know where I can find code for implementations of the
> unification algorithm
On Tue, Nov 30, 2010 at 12:25 PM, Luke Jordan wrote:
> Yes, using DrRacket it's really really easy to interface with help, explore
> libraries, etc., at least as far as I have found for my humble needs. It
> uses racket/doc/search/search-context.html.
The main problem with searching is that the
Your problem is that you are not using generative recursion.
Structural recursion is based on breaking down the structure of the
input into its parts, recursing on the parts, then combining the
results to get the final answer. Since your solution is based on
breaking down n into its divisors, you
On Thu, Oct 14, 2010 at 2:26 PM, Joe Marshall wrote:
> Here's a fast way to get the leftmost digit of a number:
> ...
> This version is slightly slower for small numbers, but much much better
> for large ones:
> (defun leftmost-digit (n base)
> (if (> base n)
> n
> (do* ((i base next)
>
Since Shriram seemed to be encouraging cleverness in representation, I
submit the following solution, which assumes the inputs and outputs
are in binary.
(define (benford l)
'(1 1.0))
Justin
_
For list-related administrative tasks:
http:/
Mine's basically the same as everyone else's, except I find the first
digit using math instead of string conversion.
#lang racket
;; Compute the base-10 logarithm of a number
(define (log10 x)
(/ (log x) (log 10)))
; Compute the first (base-10) digit of a number
(define (first-digit n)
(inex
On Sat, Oct 9, 2010 at 8:00 PM, David Herman wrote:
> Ah, yes, I didn't see Carl's solution, which is pleasantly concise and
> particularly nice because of the single case.
> But I still think the point about fall-through is important to the
> performance model of `switch' -- it's what Duff's De
Depending on why you're using thunks, you could replace them with promises:
(map force
(list
(delay 1)
(delay 2)
(delay 3))) => '(1 2 3)
Justin
On Thu, Sep 23, 2010 at 8:35 AM, Tim Brown wrote:
> Folks,
>
> Am I missing something really basic here?
>
> I have a list of thunks. I want
This is a bug/limitation of the Windows implementation. I filed a bug
report against this a few months ago
(http://bugs.racket-lang.org/query/?cmd=view&pr=10969). It apparently
has something to do with the way 1-pixel lines are drawn and clipped
on different platforms.
Justin
On Fri, Sep 10, 20
I put the following in my definitions window (Beginning Student Language).
(define (f x)
(+ x 1))
(+ (f 3) 1)
When I open the Stepper, (f 3) is highlighted in green, as expected.
If I click "Step >", the expression changes to (+ (+ 3 1) 1), as
expected (it stepped into the function). However,
Thanks! That worked.
Justin
On Sun, Aug 8, 2010 at 3:41 PM, Hari Prashanth wrote:
> You must use #lang slideshow. If you use #lang racket you get that error.
> I dont know why or what it means.
>
> HTH
> Hari
>
> - Original Message -
> From: "Justin Zamora&
I'm using the simple "Hello, World" slideshow from the docs:
#lang slideshow
(slide
#:title "How to Say Hello"
(t "Hello World!"))
When I run get-slides-as-picts, I get the following error:
> (get-slides-as-picts "simple-slide.rkt" 1024 768 false)
send: target is not an object: #f for method:
The Algol 60 language doesn't seem to work with procedures of no
arguments. For example, the following works as expected:
begin
integer procedure P(x);
begin
P := 3;
end;
printn(P(2));
end
But if I change P to take no arguments, I get an error:
begin
integer procedure P;
begin
What #lang line do I need to use for the Algol 60 language?
Justin
_
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users
How can I remove a teachpack from the list of User-installed teachpacks?
Justin
_
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users
59 matches
Mail list logo