线上学python哪里学_大家都是在哪里学习的python?

Python的学习资料,网上随便搜都是大把的

不过那些基本上没什么干货

好的学习资料是系统的,全面的

从实战例子,到工具到源码,都全面的很

片面的学习,你肯定是学不好的

而且,大多数资料都是一堆理论的东西,给你看几次,就没了兴趣了

我这里有很多真正的实战项目资料,有需要的可以找我来拿

参考下图找我

let rec print_abbrev fs = function

| Return {recursive= false; stk= s} ->

print_abbrev fs s ;

Format.pp_print_char fs 'R'

| Return {recursive= true; stk= s} ->

print_abbrev fs s ;

Format.pp_print_string fs "R↑"

| Throw (_, s) ->

print_abbrev fs s ;

Format.pp_print_char fs 'T'

| Empty -> ()

let invariant s =

let@ () = Invariant.invariant [%here] s [%sexp_of: t] in

match s with

| Return _ | Throw (_, Return _) | Empty -> ()

| Throw _ -> fail "malformed stack: %a" print_abbrev s ()

let empty = Empty |> check invariant

let push_return Llair.{callee= {formals; locals}; return; recursive}

from_call stk =

Return {recursive; dst= return; formals; locals; from_call; stk}

|> check invariant

let push_throw jmp stk =

(match jmp with None -> stk | Some jmp -> Throw (jmp, stk))

|> check invariant

let push_call (Llair.{return; throw} as call) ~bound from_call stk =

[%Trace.call fun {pf} -> pf "%a" print_abbrev stk]

;

let rec count_f_in_stack acc f = function

| Return {stk= next_frame; dst= dest_block} ->

count_f_in_stack

(if Llair.Jump.equal dest_block f then acc + 1 else acc)

f next_frame

| _ -> acc

in

let n = count_f_in_stack 0 return stk in

( if n > bound then None

else Some (push_throw throw (push_return call from_call stk)) )

|>

[%Trace.retn fun {pf} _ ->

pf "%d of %a on stack" n Llair.Jump.pp return]

let rec pop_return = function

| Throw (_, stk) -> pop_return stk

| Return {from_call; dst; stk} -> Some (from_call, dst, stk)

| Empty -> None

let pop_throw stk ~init ~unwind =

let rec pop_throw_ state = function

| Return {formals; locals; from_call; stk} ->

pop_throw_ (unwind formals locals from_call state) stk

| Throw (dst, Return {from_call; stk}) ->

Some (from_call, dst, stk, state)

| Empty -> None

| Throw _ as stk -> violates invariant stk

in

pop_throw_ init stk

end

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值