Hello,
I just built an indenter for a #lang I wrote, and placed it into the get-info
function. It seems that by default, Racket will only call the indenter if you
tell it to (by hitting tab or control I) or when you hit enter. In the latter
case, it will only indent the line you're on after
Hello,
Let's say I have a program the user entered that just looks like
1 + 2
and I have three different #langs, all with different parsers and different
notions of addition, for which this is a valid program. I'm looking to make it
so that this program outputs the following:
"Output for
gt; language
>
>
> Something like `raco mystery-lang -L lang1 -L lang2 -L lang3 file.txt`
>
>
>
>
> In case you need an example raco-command:
> https://github.com/AlexKnauth/syntax-sloc/blob/master/syntax-sloc/info.rkt
>
>
>
> On Sat, Aug 12, 2017 at 7:4
Hey all,
One of the things that confuses me most in Racket is good error handling, and
the continuations that are involved.
Is it possible to raise an error, have the user see it, but then still go on
running the code? I can currently catch an error, display it as a string/other
formats and
Hello,
In the regular #racket, the following program
(define a 1)
(define a 2)
will result in a syntax error letting you know that you have a duplicate
identifier. I would like to make my own define that throws a custom error
message in this case. I.e.
(define-syntax (my-define stx)
ows support symbolic links, only an
> administrator can create them. Package authors need to take that into
> account and not include symbolic links in a package if it's meant to
> be installed on Windows.
>
> At Mon, 17 Jul 2017 09:18:55 -0700 (PDT), Sam Waxman wrote:
> > Hello,
&g
Hello,
Suppose I'd like a type-checking macro that looks something like this:
(define-syntax (type-check stx)
(syntax-case stx ()
[(_ (+ x y)) (if (and (number? (type-check #'x))
(number? (type-check #'y)))
#'Number #'(error "bad
vorite-numbers '(1 2 3))
>
>
>
> (define (duplicate-exists? n)
>
> (member n my-favorite-numbers))
>
>
>
> (duplicate-exists? 3)
>
> (duplicate-exists? 4)
>
>
>
>
>
>
>
>
>
>
>
> > On Jul 17, 2017, at 3:43 AM, Sam Wa
Probably a silly question but I can't figure out how to get this working.
I want to have a syntax class that I can pass arguments into. So,
(define-syntax-class (my-syn-class argument)
...
)
(syntax-parse #'some-syntax
[(_ x:**)])
In place of ** what do I write to pass the
ed 1 positional argument; got 0 positional arguments in:
id:my-id
and when I write it with the parentheses like I did in the last example I get
my-let: expected more terms at: () within: (my-let ([x 2]) 1) in: (my-let ([x
2]) 1)
On Monday, July 24, 2017 at 1:19:06 PM UTC-4, Alex Knauth wrote:
&
On Thursday, June 29, 2017 at 11:17:12 PM UTC-4, Philip McGrath wrote:
> I think you might be able to leave the reader as-is and just re-define
> #%datum to reject whatever kinds of literal data you don't want to allow.
>
>
>
> -Philip
>
>
>
> On Thu, Jun 2
On Thursday, June 29, 2017 at 11:49:49 AM UTC-4, 'John Clements' via
users-redirect wrote:
> Oops forgot to cc: list
>
> > On Jun 29, 2017, at 08:49, John Clements <cleme...@brinckerhoff.org> wrote:
> >
> >>
> >> On Jun 29, 2017, at 08:30, Sam Waxman &
Hey all,
I'm writing a #lang and am trying to raise my own errors instead of having
racket throw any errors of its own.
One of my constructs, (func name(args) body), defines a function that's able to
be called afterwards, and it desugars into a pretty regular define statement.
As a result, I
On Thursday, June 29, 2017 at 11:22:38 AM UTC-4, David K. Storrs wrote:
> On Thu, Jun 29, 2017 at 11:10 AM, Sam Waxman <samw...@gmail.com> wrote:
> Hey all,
>
>
>
> I'm writing a #lang and am trying to raise my own errors instead of having
> racket throw any errors
Hey all,
I've been running into a lot of major roadblocks when it comes to writing good
tests for some #langs that I've made, for a number of reasons.
Ideally, I want a function called
(check-eq-program? "program1" "program2")
That will run each program in a fresh module of my #lang, check what
On Thursday, June 29, 2017 at 11:47:00 AM UTC-4, Matthew Flatt wrote:
> At Thu, 29 Jun 2017 08:10:25 -0700 (PDT), Sam Waxman wrote:
> > One of my constructs, (func name(args) body), defines a function that's
> > able
> > to be called afterwards, and it desugars into a
Hello,
I'm trying to test whether or not certain programs result in syntax errors. For
example the program
#lang racket
a
will result in an unbound identifier error, even before runtime (you'll see the
little error message at the bottom because it errored in phase 1).
I know how to catch
Hello,
I have a function, foo, that I define in a file, and then use later on in that
file in multiple other functions. In some of the functions, I need foo at phase
0. In others, I need it at phase 1.
Is there a way to define foo in both phases at once, or do you need to copy and
paste the
Hello,
I really need a provide macro with the following style
(provide
(un-prefix-out "..Some-file/modulepath" number))
Where the number will determine how many characters to delete from each
identifier before exporting them.
I.e., if we were to require racket as
(require
(prefix-in
I've recently run into some ambiguous identifier errors while writing a reader,
and I'm not sure how to solve them.
The situation is as follows:
I've created a version of "let" in one file. I'd like my reader to call it
whenever the user types something like
a = 3
body ...
which should be
If I have code like this,
(define-syntax-rule (identity x)
--
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-users+unsubscr...@googlegroups.com.
For more
If I have code like this,
(define-syntax-rule (identity x)
x)
((identity identity) 1)
At phase 1, the (identity identity) will get transformed into identity. As
macros expand outside in, however, this won't turn into (identity 1) like a
function would, it will try expanding the identity
On Friday, August 18, 2017 at 1:11:16 AM UTC-4, Alexis King wrote:
> > On Aug 17, 2017, at 21:52, Sam Waxman <samwax...@gmail.com> wrote:
> >
> > On a related note, I've read that read-syntax is supposed to return a
> > syntax-object whose lexical context is
On Friday, August 18, 2017 at 10:14:10 AM UTC-4, Matthias Felleisen wrote:
> On Aug 18, 2017, at 9:44 AM, Sam Waxman <samw...@gmail.com> wrote:
>
> On Friday, August 18, 2017 at 9:31:33 AM UTC-4, Matthias Felleisen wrote:
> On Aug 18, 2017, at 5:28 AM, Sam Waxman <sam
On Friday, August 18, 2017 at 9:31:33 AM UTC-4, Matthias Felleisen wrote:
> > On Aug 18, 2017, at 5:28 AM, Sam Waxman <samwax...@gmail.com> wrote:
> >
> > If I have code like this,
> >
> > (define-syntax-rule (identity x)
> > x)
> >
On Friday, August 18, 2017 at 12:47:45 AM UTC-4, Sam Waxman wrote:
> I've recently run into some ambiguous identifier errors while writing a
> reader, and I'm not sure how to solve them.
>
> The situation is as follows:
>
> I've created a version of "let" in one file
Hey all,
I'm trying to write a few #langs in racket, and I've been making use of the
#%datum, #%app, and a few of the other macros that automatically wrap certain
types of expressions. Is there a wrapper like this that works for determining
the values that are bound to variables? (I.e. so that
define larry (+ 1 moe)))
> (list larry curly moe))
>
> '(2 0 1)
>
> - Sam Caldwell
>
> [1] http://docs.racket-lang.org/guide/begin.html
>
>
> On Thu, Jun 22, 2017 at 3:40 PM, Sam Waxman <samw...@gmail.com> wrote:
> Hello,
>
>
>
> It's sim
Hello,
It's simple enough to write a macro that defines something.
(define-syntax-rule (my-define name binding)
(define name binding))
But what if I would like to define multiple things? I.e.
(define-syntax-rule (my-multiple-define name ... binding ...)
(define name binding) ...)
The
Hello,
I was having trouble figuring out how to get racket to print values however I
wanted. In particular, I was hoping to make exact nums print as decimals and
true print as true (and not #t or #true). It would also be nice if I could
custom print procedures so that + printed as plain old +
Let's say I have a module that looks like
(module a racket
(provide result)
(print "Annoying print line!")
(define result 2))
and I'd like the value of result in another module, so in another module, I
write
(require a)
or
(dynamic-require ''a 'result)
In both cases, I get the
I wrote a custom printer, and the printer itself has side-effects. As such, I
need to be absolutely certain that when I print something, the print function
only gets called once.
When checking my test cases, things were failing, and then I found out that
Racket calls the print function
Lets say I have a macro
(define-syntax (macro stx)
(syntax-parse stx
[(_ (var1 ...) (var 2 ...))
#'(begin
(begin
(do-something (#freeze var1) var2)
...)
...)]))
and I want to iterate first over var2, and then over var1. So if I type
(macro (1 2
33 matches
Mail list logo