
It’s worth checking to make sure the server software handling the http requests isn’t truncating the POSTed payload if its size exceeds a limit.
PHP for example will truncate if the data exceeds a limit of 8MB in its default config.
This may explain the errors you’re seeing.

mornin yall, I’m still quite new to this language and am trying to do something along the lines of if(condition)
{
return;
}

always forget you have to shift enter in slack sorry

The return should jump out of the function?

correct

looking through the docs I couldn’t immidiately find anything that did that

@jestarray you can use a different (and thus fewer-dependency) image manipulation library (perhaps pict
or racket/draw
). However, the executable is likely to be relatively large regardless of what you do.

The the way I write it myself is with let/ec
: #lang racket
(define (foo x)
(let/ec abort
(for/last ([n (in-range 10)])
(if (= x n)
(abort n)
n))))
(foo 3) ; -> 3
(foo 100) ; -> 9

Yes, that’s reasonable. Unfortunately that longer-term might be quite long.

But most of the time you can write your program to avoid let/ec and just pass values around and return the value at the end

If you’re new, I’d advise against let/ec

Alright thank you, that helps

@samth regardless of what I do?! why is it so large..

It includes the full racket executable and associated shared libraries (such as pango and cairo for graphics), as well as the compiled code for all the Racket libraries you use.

checked the lib folder and one of the linked ones is openssl … libeay32.dll
, how do i know what dependencies link to what dll ?

how do i run racket file wtih cli arguments in drracket? Language -> Choose Language -> Command-line arguments as a vector of strings, in read syntax
doesn’t save and work

I did that this morning

(require racket/cmdline)
(define who (box "world"))
(command-line
#:program "my-program"
#:once-each
[("-n" "--name") name "Who to say hello to" (set-box! who name)]
#:args ()
(printf "hello ~a~n" (unbox who)))


gets me Welcome to DrRacket, version 7.8 [cs].
Language: racket/base, with debugging [custom]; memory limit: 128 MB.
hello Stephen

ohhh, youre supposed to tick “Always use the same #lang line” ?

I dotn think that has an impact. it just prepopulates when oyu do file new

Yeah, the vector field is the important one.

huh… welp, i had no idea what was going on then… it works now

but tried 5 times populating the vector field and it kept resetting

now it doesnt …

That is weird> can you make it do it again? What did you change?
BTW this example gets created when you type raco pkg new

@jestarray: you may be interested in https://docs.racket-lang.org/drracket-cmdline-args/

ahh, #("D:\Programs\TOOLS\base.png")
kept resetting it.. i had to escape the backslashes

Is it a bug that an improper value in that field doesn’t make an error dialog?

seems so, it just kept resetting it silently and i had no idea why lol…

FWIW, in drracket-cmdline-args
, any error will be reported immediately via the background color

(define optimize-level (make-parameter 0))
(define file-to-compile
(command-line
#:once-any
[("-o" "--optimize-1") "Compile with optimization level 1"
(optimize-level 1)]
["--optimize-2" (; show help on separate lines
"Compile with optimization level 2,"
"which includes all of level 1")
(optimize-level 2)]
)
; this here is never 2 even if I run the cli with --optimize-2
(cond ([(= (optimize-level) 2) (print "opt at level 2"]))
when i run my cli with --optimize-2
, and check optimize-level
with the cond below later, the optimize-level is still 0.. how do i fix this?

After fixing paren mismatch in the above code, it seems to work fine?

#lang racket/base
(require racket/cmdline)
(define optimize-level (make-parameter 0))
(define file-to-compile
(command-line
#:once-any
[("-o" "--optimize-1") "Compile with optimization level 1"
(optimize-level 1)]
["--optimize-2" (; show help on separate lines
"Compile with optimization level 2,"
"which includes all of level 1")
(optimize-level 2)]
))
; this here is never 2 even if I run the cli with --optimize-2
(cond [(= (optimize-level) 2) (print "opt at level 2")])

prints "opt at level 2"
when (current-command-line-arguments)
is #("--optimize-2")

Nice!

ahhh, flags have to go first before args


[("-l" "--link-flags") lf ; flag takes one argument
"Add a flag <lf> for the linker"
(link-flags (cons lf (link-flags)))]
so this only takes 1 argument , e.g cli.exe -l "one" "two"
, “two” will be ignored. How do i make it so it takes an N number of arguments?

They are in the same order as you normally pass them at the command line.

[("-l" "--link-flags") lf lf2 ; flag takes two arguments
"Add a flag <lf> for the linker"
(link-flags (cons lf (link-flags)))]
I think?



For an answer to the “n arguments” look at #:args
.

how do i expand it infinitely though? because i don’t know the size of -l

That doesn’t make sense: it would make parsing ambiguous.

ahhh ok

@sorawee great plugin!

Consider having a flag taking arbitrary number of arguments, and also having #:args
, then how do you know which one should be in args
and which one should be in flag?

So if you truly want to take arbitrary number of arguments, use #:args
for that.

If I remember correctly, commands like gcc
(the C compiler) also requires the user to write -l
before each lib.

welp, if anyone knows a significantly lighter 2htdp/image for cropping pngs, ping me

(system* "convert" ...)
? ;)

may I ask why is this important? 34Mb is not that big when looking at the disk sizes, and also it can be downloaded quickly over pretty much any Internet connection…
Anyway, if you are looking for the smallest possible executable, you will need to write a C program that uses libpng
directly. Sure, this is more complex that the Racket solution, but it will definitely be very small.
Also consider this: • your program is 34 Mb • shipping it as a script and telling your users to install Racket will use 469Mb • telling your users to install ImageMagick and giving them a batch script to crop images would tale 100Mb.

I got jealous that dot net has dotnet new
with lots of templates so I made a GitHub template for a cli command https://github.com/spdegabrielle/cli-command\|https://github.com/spdegabrielle/cli-command
If you have an idea for a template you should make one!

After ignoring google groups for years google has just https://support.google.com/groups/answer/9718200?hl=en\|deprecated the ability to post from a mobile device :face_with_symbols_on_mouth:

> Allowing user who aren’t signed in to a Google Account to view Groups > s planned for deprecation :face_with_symbols_on_mouth:

interesting! I didn’t know how it compares to other solutions

and no reason other than it just “feels wrong” to force my users to download a 34MB file that just crops and sorts sprite sheets in a particular way

not used to big executable sizes coming from buliding stuff in rust

we could jump racket discussions from google groups to discourse https://www.discourse.org/ ! I’m unsure who of the racket team can claim it but they give out free instances to open source projects with more than 10 contributors https://blog.discourse.org/2018/11/free-hosting-for-open-source-v2/

google groups is a sloggy experience on both desktop and mobile in my experience …

Oooh. I am not aware of this v2 plan. And I really like discourse.

https://free.discourse.group/ , still available! whoever is incharge of the mailing list and stuff please consider applying!

Intersting: • it can be used as a web forum or a mailing list • Local logins are the default (some racketeers are uncomfortable with google login etc.) • social logins (google, github, etc.) can be enabled • not a walled garden - can be searched even shows up on wayback https://web.archive.org/web/20200218120823/https://meta.discourse.org/t/importing-mailing-lists-mbox-listserv-google-groups-emails/79773

Mailing list functionality varied reports - on a wikipmedia page from 2018 indicated it was less than good.

Can you provide more context of the origin problem?

@bensisva has joined the channel

All this would be solved if racket was (assumed to he) installed by default like python