Comments (3)
Why not just have a method
clipboard(f::Function) = clipboard(sprint(f))
so that you could do:
clipboard() do io
# print stuff to io
end
? (Mildly "breaking", because the current form of clipboard(f::Function)
will copy string(f)
to the clipboard, but since this is nearly useless it's hard to imagine anyone doing it. Also, we are less strict about changing interactive interfaces.)
That seems a lot clearer to me — a Clipboard::IO
device seems error-prone to me, since it's not obvious when it is "flushed" to the clipboard. When close
is called? When you call flush
? It would be tempting to use it without remembering to close
it.
from julia.
Or something like:
open(InteractiveUtils.clipboard) do io
code_llvm(io, foo, ())
end
I think we would want to typically encourage doing this with local state, especially since there likely needs to be an explicit close(io)
event that actually flushes everything to the clipboard.
from julia.
Where the above code would de-sugar to:
sprint() do io
code_llvm(io, foo, ())
end |> clipboard
from julia.
Related Issues (20)
- Inlined dispatch uses incorrect (type-equivalent, but not egal) type HOT 2
- sinc not generic enough for autodiff? HOT 1
- macOS: could not load library "Cocoa.framework/Cocoa" HOT 2
- julialauncher.exe Bad Image error for updating to Julia version 1.10.1 on Windows 11
- Allow QR decomposition for zero-row matrices. HOT 2
- need Array `typeinfo` support for NamedTuple HOT 2
- Accumulate eagerly throws, ignoring side effects [low priority] HOT 1
- regression in inference performance caused by CodeInstance refactor HOT 2
- Scoped Values documentation HOT 5
- Corruption in logging output HOT 8
- unaligned display(::Matrix{Any}) containing ZonedDateTime
- A way to list accessible names HOT 2
- GC tuning_factor might need more tuning HOT 1
- Types documentation in manual does not describe using implicit keyword arguments (semi-colon)
- Still gc crash HOT 2
- `isconst` has surprising and undocumented edge case behaviours HOT 2
- `@fastmath` doesn't apply to broadcasted infix operators and causes syntax errors
- `SingularException` when dividing `lu` on zero-dimensional matrices of some generic types HOT 4
- REPL can't paste empty or comment prompt lines HOT 1
- Track issues with external abstract interpreter from the recent `CodeInstance` refactors HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from julia.