# Nice weird feature on pasting julia\> code

**URL:** <https://discourse.julialang.org/t/nice-weird-feature-on-pasting-julia-code/15020>\
**Category:** New to Julia\
**Created:** [September 16, 2018, 3:53pm UTC](https://discourse.julialang.org/t/nice-weird-feature-on-pasting-julia-code/15020 "2018-09-16T15:53:32Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [September 16, 2018, 4:17pm UTC](https://discourse.julialang.org/t/nice-weird-feature-on-pasting-julia-code/15020/3 "2018-09-16T16:17:28Z")

</div>

> <https://github.com/JuliaLang/julia/pull/17599>
>
> It is common to encounter example code that is posted with the REPL prefix inclu…ded (typically \`julia\>\`). This occurs in manual, doc tests and in forum posts etc. Usually one wants to quickly run this code in the REPL but then has to manually remove all the prompt prefixes first which can be a bit annoying.
> 
> This PR simply checks if the statement being evaluated in the REPL starts with the REPL prefix and in that case removes it.
> 
> As an example pasting this code block:
> 
> \`\`\` jl
> julia\> const x = 1;
> 
> julia\> function foo(x)
> return x + 1
> end;
> 
> julia\> type X
> x::Int
> end;
> \`\`\`
> 
> will be equivalent to pasting it without the \`julia\>\` prefixes.
> 
> This is also implemented for the other REPL modes.
> 
> fixes https://github.com/JuliaLang/julia/issues/16383

[![](https://global.discourse-cdn.com/julialang/original/3X/7/6/76ea80311e698b1c22211ca0e87c49859dd2cd17.jpeg "JuliaCon 2017 | OhMyREPL.jl: This is my REPL ... | Kristoffer Carlsson") ](https://www.youtube.com/watch?v=dDjH26p2BhE&t=861)

[The Julia REPL · The Julia Language](https://docs.julialang.org/en/v1/stdlib/REPL/#The-Julian-mode-1) last paragraph.

---

_[View the full topic](https://discourse.julialang.org/t/nice-weird-feature-on-pasting-julia-code/15020)._
