Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2
On Mon, 15 Jul 2019 at 08:47 -0400, Hendrik Boom wrote: > On Mon, Jul 15, 2019 at 01:22:20PM +0100, Jack Rosenthal wrote: > > One of my gripes from writing and reading (reviewing) C code on a daily > > basis is that I have a hard time remembering the precedence of the > > operators beyond PEMDAS. Things get murky when trying to figure out the > > order of the other operators. And as soon as you start allowing infix, > > you better allow extending it, for better or worse. > > The one I always have trouble with is the precedence between prefix * and > postfix []. There would have been no confusion if both had been postfic > operators. Mind you, then they might have had to use a different symbol for > dereference to avoid confusion with multiplication. *p++ ;) -- Jack M. Rosenthal http://jack.rosenth.al Computers were a mistake. -- Ethan Hunter -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20190715131005.GA4615%40rosenth.al. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [racket-users] The case, and a proposal, for elegant syntax in #lang racket2
I think you make valid points, I just wanted to provide an alternate opinion... On Sun, 14 Jul 2019 at 13:44 -0400, Christopher Lemmer Webber wrote: > - The challenge with s-expressions is largely in anxiety with something >that looks extremely alien. I suspect there's more fear from >instructors than students in encountering a lisp syntax; my >experience is that introducing someone who doesn't know differently >to a parenthetical syntax isn't scary for them, and they tend to like >it. But people who have *started out* with experience in a non-lispy >language tend to find it scary. On the contrary, there are plenty of other languages to choose from for non-SE syntax, including many which have been successfully used as a teaching language (Python, Java, ...). Yes, some people use Racket as a teaching language. But given Racket's position in the languages ecosystem, instructors probably come to Racket due to it's unfamiliar syntax... > > - Nonetheless, assumptions that various math operators should be infix >is understandable because that's what people see today. One of my gripes from writing and reading (reviewing) C code on a daily basis is that I have a hard time remembering the precedence of the operators beyond PEMDAS. Things get murky when trying to figure out the order of the other operators. And as soon as you start allowing infix, you better allow extending it, for better or worse. > - I am indeed very for growth in the community, though my main interest >in growth is in seeing a wider diversity of participants than just >raw numbers. Obviously other peoples' mileage may vary. At what point are you still growing Racket instead of some other (new) language. Do we really need another Python? -- Jack M. Rosenthal http://jack.rosenth.al That code? Must have been the last guy... -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/2019071510.GA4069%40rosenth.al. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [racket-users] Racket development on ARM
On Wed, 15 May 2019 at 18:25 -0400, James Platt wrote: > I'm looking at the idea of writing Racket code on an ARM device. > Specifically, I have a tablet, which shipped with Android, with an external > keyboard. I have a few questions but I think I should start with the most > fundamental. Is Lineage OS the best choice or would something else be > better for development purposes? > You may be interested in seeing if PostmarketOS is an option: https://www.neilvandyke.org/postmarketos/ -- Jack M. Rosenthal http://jack.rosenth.al Every comment in the source code is a personal failure of the programmer, because it proves that he didn’t manage to express the purpose of the code fragment with the programming language itself. -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/racket-users/20190516011835.GA20031%40rosenth.al. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [racket-users] finding the package that a function is defined in
If you're looking for a way to speed up your workflow, if you use racket-mode in Emacs, you can press "C-c C-." with the symbol in question at point, and you'll get a handy search page with this in your browser: contract-out provided from racket/contract/base, racket/contract, racket "provided from" answers your question ;) Jack -- Jack M. Rosenthal http://jack.rosenth.al If Java had true garbage collection, most programs would delete themselves upon execution. -- Robert Sewell -- 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. signature.asc Description: PGP signature
Re: [racket-users] Claim free Discourse hosting for open source projects?
On Tue, 26 Mar 2019 at 21:00 -0700, jestar...@gmail.com wrote: > https://blog.discourse.org/2018/11/free-hosting-for-open-source-v2/ > > A lot of open source projects are transitioning to Discourse from > google groups. Discourse is an open source discussion platform and it > seems that Racket qualifies for free discourse hosting. Discourse has > a good feature set of reducing duplicate questions, better search and > so much more, see here: https://www.discourse.org/features While I can't speak for everyone on this list, I think there are quite a few folks interested in keeping all the list archives... there was a discussion about that a little while ago. I don't think Google Groups is going away any time soon... looks like there's some new settings and API changes forthcoming. [For all legal purposes, I'm not speaking on behalf of Google with that statement.] -- Jack M. Rosenthal http://jack.rosenth.al BREAKFAST.COM Halted... Cereal Port Not Responding. -- 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. signature.asc Description: PGP signature
Re: [racket-users] issue tracker for course management?
On Thu, 14 Feb 2019 at 18:14 -0500, 'John Clements' via Racket Users wrote: > Here’s the question: Do any of you that run classes with multiple > instructors/TAs/etc. use some kind of issue tracker to manage course > issues? Ideally, it would be possible for students to submit issues > but not to see them. Without this last requirement, I think nearly any > issue tracker (github/bitbucket/etc.) would work. Any experience or > advice? Would something like Piazza work? I had used this in my PL course last Fall for Q, and students can post questions only visible to instructors as well. Both me and my TA could answer these kind of questions, and they would not be visible to students. Main advantage here would be if you already use the Piazza Q platform. Students might like only having one platform to go to. Jack -- Jack M. Rosenthal http://jack.rosenth.al Programs must be written for people to read, and only incidentally for machines to execute. (SICP Preface to 1st Edition) -- 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. signature.asc Description: PGP signature
[racket-users] modules as a data format
Hi Racketeers, I've got what seems like a common way to use a #lang, make the #%module-begin provide a certain name and use a local-require to get the contents. I'm using Jens Axel's urlang and including the compiled JavaScript in some Xexpressions later on. Here's how I've set up my #%module-begin for the urlang #lang: (define-syntax-rule (module-begin body ...) (#%plain-module-begin (provide the-javascript) (define (the-javascript) (with-output-to-string (λ () (compile #'(urmodule mod body ...))) Getting the compiled JavaScript is relatively easy... (let () (local-require "js/test.rkt") (the-javascript)) However, attempting to abstract this into a macro is less easy ;). Here was my first attempt: (define-syntax-rule (urlang-js modpath) (let () (local-require (only-in modpath the-javascript)) (the-javascript))) ... later on ... (urlang-js "js/test.rkt") ; main.rkt:15:11: the-javascript: unbound identifier ; in: the-javascript ; context...: ;[common scopes] ; other binding...: ;local ;#(82760 local) #(82761 intdef) [common scopes] ; common scopes...: ;#(82611 module) #(82614 module main) #(82766 local) #(82767 intdef) ; [Due to errors, REPL is just module language, requires, and stub definitions] Oops. (Wasn't even able to (eval (expand #'(urlang-js "js/test.rkt" Attempted to fix after digging thru docs and finding syntax-local-introduce: (define-syntax (urlang-js stx) (syntax-case stx () [(_ modpath) #`(let () #,(syntax-local-introduce #'(local-require (only-in modpath the-javascript))) (the-javascript))])) Fixed usage within eval, but still no dice introducing urlang-js in code. Advice? Is there just a better way of doing this than a #lang maybe? Thanks, Jack -- Jack M. Rosenthal http://jack.rosenth.al We guarantee that each number is random individually, but we don't guarantee that more than one of them is random. -- early PMMLCG vendor -- 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. signature.asc Description: PGP signature
Re: [racket-users] Beginning of the end for googlegroups?
On Fri, 25 Jan 2019 at 23:59 +0100, 'Paulo Matos' via Racket Users wrote: > Not sure of the size of the mailing list but I wonder if this is the > beginning of the end and we should have instead a plan B. We could always go back to Mailman... Or, if someone started working on a Racket-based alternative to Mailman, I'm certain people around here would be very excited to use it. -- Jack M. Rosenthal http://jack.rosenth.al If Java had true garbage collection, most programs would delete themselves upon execution. -- Robert Sewell -- 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. signature.asc Description: PGP signature
Re: [racket-users] ann: forms
> Documentation: http://docs.racket-lang.org/forms/index.html > Source code: https://github.com/Bogdanp/racket-forms Bogdan, That looks really cool! I'll have to make use of it in a future project ;) Thanks for sharing! -- Jack M. Rosenthal http://jack.rosenth.al Be kind to everyone that you meet. -- 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. signature.asc Description: PGP signature
Re: [racket-users] Collections and data structures wishlist?
On Fri, 18 Jan 2019 at 14:22 -0800, jackhfi...@gmail.com wrote: > When it comes to collections and data structures, what would you all like > to see in Racket2? New APIs? Changes to existing APIs? Whole new paradigms? > Something else? Maybe you'll need to clarify what Racket2 is? I am not familiar. > - Distinct data types for pairs and lists, and more intuitive names for the > pair APIs (so `pair?` and `list?` would be mutually exclusive predicates > and you'd make and access pairs with `(pair 1 2)`, `(pair-first p)`, and > `(pair-second p)`. > > - A separation between using lists as homogeneous collections and using > lists as fixed-size tuples. So there'd be a separate `tuple?` data type > that's structurally equivalent to a list but meant to be used differently. > For example, `(list/c number?)` would mean a list of many numbers, but > `(tuple/c number?)` would mean a tuple of size 1 containing a number. While these changes may make the language easier to read (slightly, easier to discern programmer intent in some cases), as well as slightly more reliable (harder to write incorrect programs), you'll have to consider the negative impacts as well. Programmers would often want a way to accept what was previously considered just a list, so we might see collection/c (or a similar name) come to be defined to (or/c list/c tuple/c ...). And, to work with these collections comes generic operations (collection-first ...). This may be the paradigm in other languages like Python, but Racket is not Python. My hunch is that this would make the language harder to write in, and create potential constraints when it comes to optimization. Jack -- Jack M. Rosenthal http://jack.rosenth.al No, sir... clicking on 'Remember Password' will NOT help you remember your password. -- 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. signature.asc Description: PGP signature
Re: [racket-users] My gmail auto receives new top-level entries from [Racket Users] but not reply entries...
On Tue, 15 Jan 2019 at 15:04 -0800, infodeveloperdon wrote: > Can anyone advise how I might begin to configure somewhere so that I > receive all reply entries in addition to the top-level entries that I > currently receive in my gmail account? I have this list set up on my own personal mail server, and receive my own replies. However, I have a few other lists going thru my Gmail account... and these lists do not post my replies. I think this is since the "INBOX" folder in Gmail does not include mails which have you listed in the From header, and the "Sent" folder is simply just a search for emails which do have your address in the From header. Not sure how to adjust Gmail's behavior on this. Sorry I don't have an answer; just how I think this problem is happening. Jack -- Jack M. Rosenthal http://jack.rosenth.al The effort of using machines to mimic the human mind has always struck me as rather silly: I'd rather use them to mimic something better. -- Dijkstra (EWD1036-13) -- 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. signature.asc Description: PGP signature
Re: [racket-users] Racket-openCV package use?7
On Sat, 12 Jan 2019 at 16:30 +, Stephen De Gabrielle wrote: > Hi > > Can can anyone point me to any package or other Racket code that uses the > Racket OpenCV package ? > > https://github.com/oetr/racket-opencv There is the "tutorials" directory in that repository (but this might be obvious; I imagine you've already seen this): https://github.com/oetr/racket-opencv/tree/master/tutorials Other than that, things aren't looking promising. A simple text-search for "opencv" filtered to just the Racket language on GitHub does not show anything using those bindings: https://github.com/search?l==opencv+language%3ARacket=Code (Although, GitHub's search mechanism is admittedly pretty bad, and could be skipping something here. Also, there may be code off of GitHub.) Jack -- Jack M. Rosenthal http://jack.rosenth.al More papers should list caffeine as a coauthor. -- 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. signature.asc Description: PGP signature
Re: [racket-users] Help understanding cond expression
On Sat, 12 Jan 2019 at 21:12 -0800, Hassan Shahin wrote: > When I apply the procedure to 'John it will evaluate to 'symbol. The idea > of the procedure is to check the "type" of the given item, which is not > decided aprior. If I give it 'John I know it is a symbol. > May be my question should be formulated as this: Since John is not a pair, > an empty-list, a number, not a symbol, why the execution doesn't proceed to > the else expression no matter what John is, unless you are telling me that > the item given to the procedure is evaluated first. Perhaps you meant to define John before: (define John '(1 2 3)) (type-of John) => 'pair Since type-of is a procedure, this means that when it is applied, it's arguments will be evaluated during application. Evaluating a symbol which is not defined will result in an error. -- Jack M. Rosenthal http://jack.rosenth.al A virtual filesystem? I don't know what you are trying to achieve, but there's probably a better way. -- Me -- 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. signature.asc Description: PGP signature
Re: [racket-users] Long live SDRAW.LISP -- in Racket pict!
Thanks Jens Axel! I think your metapict library is very cool --- I will have to play with it a bit more in the future. I linked your code in my GitHub README as a potential alternative. I made substantial improvements to my code, and it's a Racket package now (raco pkg install sdraw), complete with documentation: http://docs.racket-lang.org/sdraw/ I'd be interested if anyone has any suggestions to improve the interface... I think there are currently a lot of options, and it may be a bit confusing. Thanks, Jack -- Jack M. Rosenthal http://jack.rosenth.al There's only two hard problems in computer science: cache invalidation, naming things, and off-by-one errors. -- 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. signature.asc Description: PGP signature
Re: [racket-users] Escaping strings for the shell
On Fri, 28 Dec 2018 at 23:09 -0500, David Storrs wrote: > I am using 'system' to offload some work onto wget and other > applications in a few one-off scripts. Is there an easy way to escape > a string so it's suitable for usage in the shell? Things like > backwhacking all the quotes and relevant spaces and such. Is avoiding the shell altogether an option? You could use "system*" -- Jack M. Rosenthal http://jack.rosenth.al /* Return code=1: generic error condition Return code=2: all other error conditions */ -- 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. signature.asc Description: PGP signature
[racket-users] Long live SDRAW.LISP -- in Racket pict!
Greetings Racketeers, In case you are not familiar with the SDRAW program from Touretzky's "Common Lisp: A Gentle Intro to Symbolic Computation", it is a program which draws cons-cell diagrams in an X-window using CLX. The program is pretty dated, and getting it up and running on a modern machine is a little bit of work, so why not remake it in Racket -- better yet, using pict! This is exactly what I've been working on... What I've got so far is here: https://github.com/jackrosenthal/sdraw-racket Go ahead and clone it: there's only one function you need to know: sdraw. It takes either a datum or syntax and produces a pict. There's also optional keyword arguments to control some of the output parameters. You can even do things like this: (sdraw (list (face 'happy) 2 (list* 3 4 (face 'happy (and those faces will be rendered in the picture!) I'm relatively new with working in Racket, and I'm interested in: 1. Hearing any thoughts from others on how I can improve my code: either to make the code more readable, or the interface easier to understand. 2. I am still working on documentation etc., and am wondering if people think I should submit this as a pull request to the pict library, or as a separate library. I think it could be particularly useful in pict, and it is only one function anyway. Thank you, Jack -- Jack M. Rosenthal http://jack.rosenth.al We guarantee that each number is random individually, but we don't guarantee that more than one of them is random. -- early PMMLCG vendor -- 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. signature.asc Description: PGP signature
Re: [racket-users] Reasons not to use match or define/match?
On Mon, 17 Dec 2018 at 07:58 -0800, Will Jukes wrote: > After learning more Haskell I've been playing around with match and > define/match, and I'm wondering if there's any particular reason to > prefer more traditional Scheme forms over match (I vastly prefer match > in most cases). Glancing at the match module it looks the process of > expanding a match clause is pretty intricate, and the documentation > mentions that match lacks the time complexity guarantee of case, but > beyond that it's not immediately clear whether match imposes some > unacceptable overhead or etc., or to what extent it does if so. You can always use "expand" or "expand-once" to look at the code generated by the use of a match. Usually, it's just a bunch of nested conds and lets, with a function and call to check the next pattern. Haskell's pattern matching is probably compiled to something more efficient (anyone want to test this hypothesis?), but Racket's works when you need it, and has some really nice features (e.g., list-no-order and quasiquote matches). -- Jack M. Rosenthal ( http://inside.mines.edu/~jrosenth Graduate Student, Computer Science ) http://jack.rosenth.al One of the main causes of the fall of the Roman Empire was that -- lacking zero -- they had no way to indicate successful termination of their C programs. -- Robert Firth -- 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. signature.asc Description: PGP signature