[racket-users] Algol 60

2016-03-18 Thread Arthur Nunes-Harwitt

Hi,

  I'm using Racket v6.4.

  I tried to run an Algol 60 program (that worked in the past) by 
selecting the Algol 60 option in the experimental languages section. I got 
the following error message.


for-body43686: unbound identifier;
  also, no #%top syntax transformer is bound in: for-body43686

  Is Algol broken?  Is it still supported?

  Thanks.

-Arthur

==
Arthur Nunes-Harwitt
Computer Science Department, Rochester Institute of Technology
Room 70-3509
585-475-4916
==

"I don't know what the language of the future will be
called, but it will look like LISP."

This email is confidential and intended for the named recipient(s). In
the event the email is received by someone other than the recipient,
please notify the sender at a...@cs.rit.edu.


Re: [racket-users] Web server catch exceptions, print stack trace to error-logs, display simple page to user

2016-03-18 Thread 'John Clements' via Racket Users

> On Mar 17, 2016, at 11:50 AM, Marc Kaufmann  wrote:
> 
> Hi all,
> 
> I do not want people to see "Contract violation: massive stack trace 
> documenting my brilliance as a programmer" every time they hit a bug on my 
> website.
> 
> Currently I show them simply an error page and redirect the trace to stderr 
> (see code below). But this doesn't track time of the error, and so on. Is 
> there a simple way to do this (seems like it should be a common problem), or 
> at least how to easily get the time-stamp from servlet-error-response without 
> having to manually pipe everything to stderr?

I think this problem is one of the ones that falls into the “Lisp crack”: 
specifically, implementing your own solution is sufficiently easy that building 
a general-purpose solution winds up being more trouble than it’s worth, and 
never quite covers all of the various users’ requirements. Of course, this 
leads to lack of standardization.

For me, I use drracket’s log handlers, make sure that everything winds up on 
stdout, and then use ‘multilog’ from ‘daemontools’ to take care of timestamps, 
partitioning (if desired) and log rotation.

John



-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] Web server catch exceptions, print stack trace to error-logs, display simple page to user

2016-03-18 Thread 'John Clements' via Racket Users

> On Mar 17, 2016, at 4:48 PM, Marc Kaufmann  wrote:
> 
> Yep, printing that out is indeed all I want. I hadn't thought about the fact 
> that 'print and 'display will show up in standard output. 
> 
> John, how do you use drrackt's log handlers, are you running the server via 
> Drracket or did you mean something different. 

Forgive me, of course I didn’t mean “DrRacket’s log handlers,” but rather 
“racket’s log handlers”, specifically those created by `define-logger`. My 
mistake. 
> 
> I can't use daemontools for reasons to do with permissions, but I will have 
> access to supervisord, which seems to be doing the same type of tasks. 

??

I claim you can run daemontools (specifically, svscan) without any permissions 
at all. Regardless, AFAIK supervisord does in fact achieve similar ends.

John

> 
> On Thu, Mar 17, 2016 at 4:46 PM, John Clements  
> wrote:
> 
> > On Mar 17, 2016, at 11:50 AM, Marc Kaufmann  
> > wrote:
> >
> > Hi all,
> >
> > I do not want people to see "Contract violation: massive stack trace 
> > documenting my brilliance as a programmer" every time they hit a bug on my 
> > website.
> >
> > Currently I show them simply an error page and redirect the trace to stderr 
> > (see code below). But this doesn't track time of the error, and so on. Is 
> > there a simple way to do this (seems like it should be a common problem), 
> > or at least how to easily get the time-stamp from servlet-error-response 
> > without having to manually pipe everything to stderr?
> 
> I think this problem is one of the ones that falls into the “Lisp crack”: 
> specifically, implementing your own solution is sufficiently easy that 
> building a general-purpose solution winds up being more trouble than it’s 
> worth, and never quite covers all of the various users’ requirements. Of 
> course, this leads to lack of standardization.
> 
> For me, I use drracket’s log handlers, make sure that everything winds up on 
> stdout, and then use ‘multilog’ from ‘daemontools’ to take care of 
> timestamps, partitioning (if desired) and log rotation.
> 
> John
> 
> 
> 
> 



-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] predicate as an atom within a regexp?

2016-03-18 Thread Daniel Prager
Hi Matthew

Do you want the leftmost, longest substring matching the predicate?

E.g. something like (substring/p string->number "foo-46.3bar12789") returns
"-46.3"?

Dan

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racket -> HTML+JavaScript using Urlang and Ractive

2016-03-18 Thread Daniel Prager
Matthew writes:
> The idea of a subset of Racket that compiles to this kind of
statistically probable subset of JS is very appealing.

Agreed. The way Jens has split it up is that Urlang is a thin, cleaned-up
Racket-ish syntax for ES5, with a bit of sugar and a macro capability.

Then there's rjs, which includes a runtime, and aims to compile a
substantive subset of Racket. Of course there's going to be a trade-off
between completeness and runtime-size, etc.

> Especially if it can obviate the need or should I say "need" for a JS
framework.

So, I'm currently looking at some of the "better" JS / HTML / CSS
frameworks / libraries with a view to being able to hide the detail and
relatively easily spin-up browser-hosted applications. E.g.

   - CSS / reponsiveness: e.g. Bootstrap
   - DOM manipulation & binding: e.g Ractive, Mithril
   - Data structures: e.g. mori
   - Graphics: e.g. D3

I take it obviating the need for frameworks would essentially mean pulling
necessary functionality up into Racket: analogous to writing in Racket
rather than using interop to access external e.g. C/C++ libraries from
regular Racket.

Is that what you mean? Sounds good to me, but more of a "longer term"
project. Elm might be a good model for this.

Dan

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] predicate as an atom within a regexp?

2016-03-18 Thread Andrew Gwozdziewycz
On Thu, Mar 17, 2016 at 4:17 PM, Matthew Butterick  wrote:

>
> On Mar 17, 2016, at 2:05 PM, Andrew Gwozdziewycz  wrote:
>
> I am imagining an API that utilizes SCSH style regexes but allows you to
> do something like this (fictional):
>
> (define-values (area prefix line) (sre-match (: (= digits 3) (_? "-") (=
> digits 3) (_? "-") (= digits 3
>
>
>
> Racket's `match` is not far from this. In fact maybe I shouldn't be
> thinking in terms of hacking regexps, but rather making a new match
> expander. For instance, you can destructure a list like so:
>
> (match '("foo" "-42.3" "bar")
>   [(list a (? string->number b) c) 'yay]
>   [else 'boo])
>
> So it would extend logically to this pseudocode:
>
> (match "foo-42.3bar"
>   [(string-append a (? string->number b) c) 'yay]
>   [else 'boo])
>

Yup! Exactly. I really had `match` in mind. I'm not sure why you wouldn't
use regexes underneath though. As you have it, you'd be forced to call
`string->number` on every subsequence, where as constructing a regex with
grouping seemingly does this in effectively 1 pass (with possible back
tracking of course).

Still, the idea is extremely solid, and I would use such a thing
constantly.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] predicate as an atom within a regexp?

2016-03-18 Thread Matthew Butterick

On Mar 17, 2016, at 2:05 PM, Andrew Gwozdziewycz  wrote:
> I am imagining an API that utilizes SCSH style regexes but allows you to do 
> something like this (fictional):
> 
> (define-values (area prefix line) (sre-match (: (= digits 3) (_? "-") (= 
> digits 3) (_? "-") (= digits 3


Racket's `match` is not far from this. In fact maybe I shouldn't be thinking in 
terms of hacking regexps, but rather making a new match expander. For instance, 
you can destructure a list like so:

(match '("foo" "-42.3" "bar")
  [(list a (? string->number b) c) 'yay]
  [else 'boo])

So it would extend logically to this pseudocode:

(match "foo-42.3bar"
  [(string-append a (? string->number b) c) 'yay]
  [else 'boo])



On Mar 17, 2016, at 2:35 PM, Daniel Prager  wrote:
> Do you want the leftmost, longest substring matching the predicate?
> 
Sometimes, but that's not hard to figure out. More often, I want to match 
multiple predicates within one string.
 

#lang racket

(define (substring/p pred str)
  (for*/first ([strlen (in-value (string-length str))]
   [left-pos (in-range strlen)]
   [right-pos (in-range strlen left-pos -1)]
   [this-substring (in-value (substring str left-pos right-pos))]
   #:when (pred this-substring))
  this-substring))

(equal? (substring/p string->number "foo-46.3bar12789") "-46.3")

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] Racket for web apps

2016-03-18 Thread Jay McCarthy
It's great. Check out the various libraries of the web-server. I'd
suggest starting from web-server/servlet-env and web-server/dispatch.

Jay

On Fri, Mar 18, 2016 at 5:00 PM, Kaylen Wheeler  wrote:
> Hi,
>
> I'm new to Racket, but not to lisp.  I have been a Clojure user for some 
> time.  I began developing a web game in clojure/clojurescript, but I am 
> considering switching languages.
>
> How good is Racket for web-related development?
>
> Thanks
>
> --
> 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 options, visit https://groups.google.com/d/optout.



-- 
Jay McCarthy
Associate Professor
PLT @ CS @ UMass Lowell
http://jeapostrophe.github.io

   "Wherefore, be not weary in well-doing,
  for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
  - D 64:33

-- 
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 options, visit https://groups.google.com/d/optout.


[racket-users] predicate as an atom within a regexp?

2016-03-18 Thread Matthew Butterick
What is the best approach to destructuring strings using predicates? For 
instance "match a substring for which `string->number` is true." 

I can approximate this using `regexp-match-positions` and stepping through 
possible substrings, testing until one matches, etc. 

But I notice that this amounts to treating a predicate as an atom. Since atoms 
like '\\d' and '\\w' are pretty much predicates in disguise, it made me wonder 
if there were a way to atom-ize an arbitrary predicate.

-- 
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 options, visit https://groups.google.com/d/optout.


Re: [racket-users] Web server catch exceptions, print stack trace to error-logs, display simple page to user

2016-03-18 Thread Marc Kaufmann
Hm, it sounded like I needed sudo rights to run daemontools if I want to
use it to start racket as sudo (I may be wrong). Either way, the admins
told me no, so no it is. Either supervisord or daemontools are of course
several steps up from my previous way of doing things (which may justify
their reasons for not giving me said sudo rights in the first place...).

On Thu, Mar 17, 2016 at 8:29 PM, John Clements 
wrote:

>
> > On Mar 17, 2016, at 4:48 PM, Marc Kaufmann 
> wrote:
> >
> > Yep, printing that out is indeed all I want. I hadn't thought about the
> fact that 'print and 'display will show up in standard output.
> >
> > John, how do you use drrackt's log handlers, are you running the server
> via Drracket or did you mean something different.
>
> Forgive me, of course I didn’t mean “DrRacket’s log handlers,” but rather
> “racket’s log handlers”, specifically those created by `define-logger`. My
> mistake.
> >
> > I can't use daemontools for reasons to do with permissions, but I will
> have access to supervisord, which seems to be doing the same type of tasks.
>
> ??
>
> I claim you can run daemontools (specifically, svscan) without any
> permissions at all. Regardless, AFAIK supervisord does in fact achieve
> similar ends.
>
> John
>
> >
> > On Thu, Mar 17, 2016 at 4:46 PM, John Clements <
> cleme...@brinckerhoff.org> wrote:
> >
> > > On Mar 17, 2016, at 11:50 AM, Marc Kaufmann 
> wrote:
> > >
> > > Hi all,
> > >
> > > I do not want people to see "Contract violation: massive stack trace
> documenting my brilliance as a programmer" every time they hit a bug on my
> website.
> > >
> > > Currently I show them simply an error page and redirect the trace to
> stderr (see code below). But this doesn't track time of the error, and so
> on. Is there a simple way to do this (seems like it should be a common
> problem), or at least how to easily get the time-stamp from
> servlet-error-response without having to manually pipe everything to stderr?
> >
> > I think this problem is one of the ones that falls into the “Lisp
> crack”: specifically, implementing your own solution is sufficiently easy
> that building a general-purpose solution winds up being more trouble than
> it’s worth, and never quite covers all of the various users’ requirements.
> Of course, this leads to lack of standardization.
> >
> > For me, I use drracket’s log handlers, make sure that everything winds
> up on stdout, and then use ‘multilog’ from ‘daemontools’ to take care of
> timestamps, partitioning (if desired) and log rotation.
> >
> > John
> >
> >
> >
> >
>
>
>
>

-- 
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 options, visit https://groups.google.com/d/optout.


RE: [racket-users] dynamic-require

2016-03-18 Thread Jos Koot
Ir works fine.
I must have overlooked something in the docs.
Thanks again.
Jos
 

  _  

From: Scott Moore [mailto:sc...@thinkmoore.net] On Behalf Of Scott Moore
Sent: miércoles, 16 de marzo de 2016 18:05
To: Jos Koot; Racket Users
Cc: Jos Koot
Subject: Re: [racket-users] dynamic-require


If the definitions are saved as “test.rkt”, the following works: 

#lang racket 

(module a racket/base (displayln "hello")) 
(dynamic-require '(submod "test.rkt" a) #f) 


On March 16, 2016 at 12:13:46 PM, Jos Koot (jos.k...@gmail.com) wrote:


Hi,
 
The following example of dynamic-require in the reference manual works in
the interactions window of DrRacket, but not in its definitions window:
 
(module a racket/base (displayln "hello"))
(dynamic-require ''a #f)
 
How do I do this in the definitions window?
 
The reason I use dynamic-require is that I want to set some parameters
before submod a is executed.
 
I found out I can do the following:
 
#lang racket
(module a racket/base (displayln "hello"))
(module b racket/base (current-output-port (open-output-file ...)))
(require 'b)
(require 'a)
 
To me this seems an ugly trick.
In addition I am not sure this is guaranteed to work consistently.
How can I dynamically require a submod in the same source as it is defined?
 
Jos
--
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 options, visit https://groups.google.com/d/optout
 .


-- 
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 options, visit https://groups.google.com/d/optout.


[racket-users] new #lang sicp

2016-03-18 Thread Neil Van Dyke
Could anyone currently working through or teaching SICP please try out 
the new `#lang sicp` support, in Jens Axel Sogaard's `sicp` package in 
the new package system?


http://docs.racket-lang.org/sicp-manual/

If you find any problems with this, please let me and Jens Axel know.

I'd prefer to shake out any glaring problems now, before people start 
working through SICP in the summer or September.  (I expect a few 
problems, and I don't want them to be first encountered by new students 
trying to do their homework, so am "crowdsourcing QA" in advance.)


I've updated my old PLaneT package 
("http://www.neilvandyke.org/racket/sicp/;) to point people to Jens 
Axel's new one.


Neil V.

--
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 options, visit https://groups.google.com/d/optout.