[racket-users] Concise way to get completions for Racket code?
My google-fu is failing me today. Is there a concise way in Racket to request possible completions for some Racket code? For example, in powershell I can ask System.Management.Automation.CommandCompletion for possible completions of the powershell code "ConvertTo-Json -" like this: $cmd = "ConvertTo-Json -" $ret = [System.Management.Automation.CommandCompletion]::MapStringInputToParsedInput($cmd, $cmd.Length) $candidates = [System.Management.Automation.CommandCompletion]::CompleteInput( $ret.Item1, $ret.Item2, $ret.Item3, $null, [System.Management.Automation.PowerShell]::Create() ).CompletionMatches $candidates | ForEach-Object { [pscustomobject]@{ CompletionText = $_.CompletionText ResultType = $_.ResultType.ToString() ToolTip = $_.ToolTip } } Outputs (depending on system, powershell and .net version): CompletionText ResultTypeToolTip -- ----- -InputObject ParameterName [Object] InputObject -Depth ParameterName [int] Depth -CompressParameterName [switch] Compress -Verbose ParameterName [switch] Verbose -Debug ParameterName [switch] Debug -ErrorAction ParameterName [ActionPreference] ErrorAction -WarningAction ParameterName [ActionPreference] WarningAction -InformationAction ParameterName [ActionPreference] InformationAction -ErrorVariable ParameterName [string] ErrorVariable -WarningVariable ParameterName [string] WarningVariable -InformationVariable ParameterName [string] InformationVariable -OutVariable ParameterName [string] OutVariable -OutBuffer ParameterName [int] OutBuffer -PipelineVariableParameterName [string] PipelineVariable -- 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] Is there a clear 'HOWTO' for writing/posting packages?
Brilliant. Thanks, Ben. On Wed, Feb 7, 2018 at 3:30 PM, Ben Greenmanwrote: > Here are 2 how-tos on creating a package: > > http://blog.racket-lang.org/2017/10/tutorial-creating-a-package.html > > https://beautifulracket.com/jsonic-3/the-info.rkt-file.html > > > The error message might be because your repo doesn't have an `info.rkt` file. > > https://github.com/dstorrs/racket-dstorrs-libs -- 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] Is there a clear 'HOWTO' for writing/posting packages?
On Wed, Feb 7, 2018 at 3:28 PM, Matthew Flattwrote: > At Wed, 7 Feb 2018 15:16:24 -0500, David Storrs wrote: >> "Checksum problem?" I said to myself. "I didn't know there was >> anything about a checksum. The documentation made it sound like I >> simply had to point it at a repository. > > Yes, that's right. It looks like there's some problem that isn't yours. Oh, good. I was so frustrated because I couldn't figure out what I'd done wrong. > > > I think you're looking at > > http://pkg-build.racket-lang.org/server/built/archive-fail/handy.txt > > which tells you about a checksum error that the package-build service > encountered. Yes, that's right. On that subject, the error message is: pkg: cannot use empty checksum for Git repostory package source source: https://github.com/dstorrs/racket-dstorrs-libs.git I note that the word 'repository' is misspelled. > Meanwhile, > > https://pkgs.racket-lang.org/package/handy > > tells you about an error that the package-registration server suffered > in trying to get a checksum to supply the package-build service (and > clients). > > It's not great that there are two different places where errors are > reported, but the root problem seems to be an error on the server. Ah. Given that other people's packages are working fine, this is probably an issue with mine. There's no info.rkt, could that be relevant? -- 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] Is there a clear 'HOWTO' for writing/posting packages?
On Wed, Feb 7, 2018 at 4:16 PM, Neil Van Dykewrote: > Thank you for going to the extra effort to share open source packages. > > BTW, while there's always been motive, since the dawn of programming, for an > individual project or person to have a "'s collection of > utilities", I think that *reuse* value generally increases when we break > this up into fairly independent topical collection. > > Sometimes this results in packages with only one procedure, such as > "http://www.neilvandyke.org/racket/canonicalize-path/;, but which I could > imagine wanting to use without any of the much more specific > "http://www.neilvandyke.org/racket/mediafile/; code for which it was > originally written. Yep, 100% agreed that 'utils.rkt' is a bad thing. If you check the description in the README.md it says "utils.rkt => overly bloated collection of random things. Should be split up." I've been shopping around for tuits and I'll do the splitting when I find a good supplier. Aside from 'utils.rkt' and 'list-utils.rkt' I think the others are fairly reasonable. Dave > -- 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] Is there a clear 'HOWTO' for writing/posting packages?
Thank you for going to the extra effort to share open source packages. BTW, while there's always been motive, since the dawn of programming, for an individual project or person to have a "'s collection of utilities", I think that *reuse* value generally increases when we break this up into fairly independent topical collection. Sometimes this results in packages with only one procedure, such as "http://www.neilvandyke.org/racket/canonicalize-path/;, but which I could imagine wanting to use without any of the much more specific "http://www.neilvandyke.org/racket/mediafile/; code for which it was originally written. -- 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] Is there a clear 'HOWTO' for writing/posting packages?
Here are 2 how-tos on creating a package: http://blog.racket-lang.org/2017/10/tutorial-creating-a-package.html https://beautifulracket.com/jsonic-3/the-info.rkt-file.html The error message might be because your repo doesn't have an `info.rkt` file. https://github.com/dstorrs/racket-dstorrs-libs -- 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] Is there a clear 'HOWTO' for writing/posting packages?
At Wed, 7 Feb 2018 15:16:24 -0500, David Storrs wrote: > "Checksum problem?" I said to myself. "I didn't know there was > anything about a checksum. The documentation made it sound like I > simply had to point it at a repository. Yes, that's right. It looks like there's some problem that isn't yours. I think you're looking at http://pkg-build.racket-lang.org/server/built/archive-fail/handy.txt which tells you about a checksum error that the package-build service encountered. Meanwhile, https://pkgs.racket-lang.org/package/handy tells you about an error that the package-registration server suffered in trying to get a checksum to supply the package-build service (and clients). It's not great that there are two different places where errors are reported, but the root problem seems to be an error on the server. -- 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] Is there a clear 'HOWTO' for writing/posting packages?
tl;dr Is there a clear 'HOWTO' for how to write packages such that they can be put up on https://pkgs.racket-lang.org/ and subsequently installed by people who aren't the developer? Long version: The Racket documentation is great, but often not terribly helpful unless you're willing to sink a lot of time in. Packages is a good example; I've been writing Racket for a year and a half now, I have a Github repository with a bunch of working code in it, and we've been using that code at my company. When my co-worker wants to use it he git clone's it, adds a path to $PLTCOLLECTS and away he goes. Despite all that, I find myself unable to grok the package documentation at https://docs.racket-lang.org/pkg/index.html Yesterday (day before?) I decided to actually put my code up on https://pkgs.racket-lang.org/ so that it could be installed through the normal raco pkg system. It was easy -- put in a name, some tags, a github link, boom. All good. It was only later that I found the package is failing and cannot be downloaded due to a checksum problem. "Checksum problem?" I said to myself. "I didn't know there was anything about a checksum. The documentation made it sound like I simply had to point it at a repository. Well, let me go RTFM and see what I did wrong." An hour later I am intensely frustrated and no closer to actually solving the problem. I try to read this stuff and it simply bounces. Here's a good example, quoted directly from https://docs.racket-lang.org/pkg/getting-started.html : "A package is not something that you refer to directly in your Racket programs. Instead, a package is a set of libraries that fit into the collection hierarchy, and you refer to libraries through their collection-based paths. Libraries that are close in the hierarchy may be provided by different packages, while a single package may provide libraries that are far from each other in the hierarchy (but that are conceptually related, somehow)." This leaves me no wiser as to what the hell these things actually are in practical terms, which isn't terribly reassuring since this is the initial paragraph of the "What is a Package?" section. Could someone please Explain Like I'm 5 ? Or, preferably, point me to a source that does that? Here's what my filesystem looks like: /home/dstorrs/.../racket/handy |-- utils.rkt |-- list-utils.rkt |-- db.rkt ...etc In my code I can do this: (require handy/utils) and it works fine. I have no idea what in here is the package, the collection, the library, etc. I'm guessing that 'utils.rkt' is a library but no idea on the rest. If I can actually get a handle on all this I'm perfectly happy to write a "How to Develop Packages for Idiots and English Majors" document and submit it for inclusion. In the meantime I'll go beat my head on the docs some more. -- 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.