samth
2019-10-21 11:44:04

I think you’ll have to try; I don’t remember a particular decision to stop supporting windows 2000


steveh2009
2019-10-21 12:33:57

It would probably have to do with what version of the Microsoft C/C++ compiler stopped supporting their runtime libraries for win 2000 then.


capfredf
2019-10-21 13:07:06

@mflatt, I have a question about adding new built-in function to racket-on-chez:


capfredf
2019-10-21 13:07:46

Here is the changeset: https://github.com/capfredf/racket/commit/222bc83babde7c023ec79181fd0ad807b38d1067

What I have trying to do is to add the function struct-type-property-predicate-procedure?


capfredf
2019-10-21 13:09:27

make run is successful, but I still can’t use the function in Racket-on-Chez. I am guessing I need to export the identifier elsewhere other than racket/src/cs/primitive/kernel.ss


samth
2019-10-21 13:10:59

The issue is that the expander has to know about the list of built-in names


samth
2019-10-21 13:11:17

and I think that’s computed when the expander is extracted


samth
2019-10-21 13:13:59

see expander/boot/kernel.rkt among others


samth
2019-10-21 13:14:36

I forget what the new steps to add a primitive function are, but I think you may have to add a stub version to the traditional backend as well


steveh2009
2019-10-21 13:14:51

My guess though is the last runtimes which came with Visual Studio 2005 as that’s the last supported VS for Win 2000.


samth
2019-10-21 13:15:18

Are you thinking about compiling it yourself? or using the pre-built binaries.


samth
2019-10-21 13:15:25

But again, I would just try them out.


steveh2009
2019-10-21 13:15:31

Pre-built


capfredf
2019-10-21 13:15:33

@samth, thank you. I am thinking about adding a stub to cvm as well.


steveh2009
2019-10-21 13:18:09

For building, I’m curious how far I can get to porting the non-gui parts of Racket to Haiku.


steveh2009
2019-10-21 13:26:12

Matt’s ’99 paper about MrEd kinda surprised me when he mentioned non-gui parts of PLT running on BeOS.


samth
2019-10-21 13:26:41

I expect the GUI portions should be more likely to work post 5.1, at least if Gtk works


mflatt
2019-10-21 13:54:19

@capfredf You’ve done what is minimally needed for Racket CS. Probably the racket/base module hasn’t been rebuilt, so it still has the old list of primitives from its (provide (all-from-out '#%kernel)). Also, the mismatch between Racket CS and traditional Racket is likely to cause trouble, as Sam suggests. Generally, it’s best to add a primitive in both places and increment the version number, and then things will build consistently.


capfredf
2019-10-21 14:54:56

@mflatt Thank you. I made it work by adding a stub and changing other things accordingly. But when I ran make in-place in the root directory of my racket repo, I got: inspector-superior?: arity mismatch; the expected number of arguments does not match the given number expected: 2 given: 0 So I pulled down a clean repo, rebuild the development mode. I wonder why there isn’t a clean rule in the makefile in the root directory. Or did I miss anything?


mflatt
2019-10-21 14:56:27

Instead of having a clean that is always half-broken because it’s difficult to get clean right, I use git clean -d -x -f. But if you changed the version number, you shouldn’t need to clean.


p.kushwaha97
2019-10-21 15:30:16

Thanks, that was indeed the issue there.


capfredf
2019-10-21 15:41:07

Thank you. I misread your message. I thought the increment to the version number only mattered when racket was built for a release.


p.kushwaha97
2019-10-21 15:51:11

Does anyone have an example of using quasiquotes with racket macros? I’m trying to make something work but it just prepares the syntax and returns it quoted, I need its return value to be considered as the macro expansion


samth
2019-10-21 15:53:08
(define-syntax (maybe-do stx) (syntax-case stx () [(_ e) #`(begin #,(if (even? (random 100)) #'e #'(void)))]))

p.kushwaha97
2019-10-21 15:57:17

What’s the # doing? I’ve only seen backtick (quasiquote) and ’ (quote) before this. Also, what kind of functions can I use at compile time? Looks like I won’t be able to use racket/list functions, it complains.


samth
2019-10-21 15:59:26

You need to do (require (for-syntax racket/list))


samth
2019-10-21 15:59:36

only racket/base is available by default at compile time


samth
2019-10-21 15:59:53

#' is like ' but for syntax objects


p.kushwaha97
2019-10-21 16:00:14

Interesting. I also found https://docs.racket-lang.org/guide/stx-obj.html for "#`" just now. Looks like I have some more reading to do.


p.kushwaha97
2019-10-21 16:00:16

Thanks!


samth
2019-10-21 16:00:52

p.kushwaha97
2019-10-21 18:36:00

This turned out to be quite useful. Thanks!


p.kushwaha97
2019-10-21 20:28:35

Can I provide type annotations to match-lambda?


p.kushwaha97
2019-10-21 20:34:05

This seems to suggest that there isn’t built-in support in match’s syntax for it: https://docs.racket-lang.org/ts-guide/more.html?q=Annotating%20Single%20Variables#%28part._.Annotating_.Single_.Variables%29.


sorawee
2019-10-21 20:59:03

You can do this:

#lang typed/racket

(: f ((Listof Number) -> Number))
(define f (match-lambda
            [(list x 1 2) x]))

steveh2009
2019-10-22 00:52:04

For the Windows build, has anyone ever mentioned that, in the file msvcprep.bat, that if you have Visual Studio 2019 Community Preview installed instead of Community, then the VCVARBAT env var path is …\2019\Preview\VC…instead of …\2019\Community\VC…


steveh2009
2019-10-22 01:04:44

Just a one-line add to the list of “if not exist” possible paths


samth
2019-10-22 01:23:45

Should be easy to add. Do you want to make a pull request?


notjack
2019-10-22 06:49:44

Splitting a string into lines using a batching transducer:

(require rebellion/collection/list
         rebellion/streaming/reducer
         rebellion/streaming/transducer)


(define str
  "Haikus are easy
But sometimes they don't make sense
Refrigerator")

(transduce str
           (batching into-line)
           #:into into-list)

Output:

'("Haikus are easy" "But sometimes they don't make sense" "Refrigerator")